-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(lint): don't suggest refutable patterns to "fix" irrefutable bind #89314
fix(lint): don't suggest refutable patterns to "fix" irrefutable bind #89314
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
3d4ccfb
to
f514884
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@bors r+ |
📌 Commit f5148848e579836251720804a5b3725cd8772d5a has been approved by |
☔ The latest upstream changes (presumably #88950) made this pull request unmergeable. Please resolve the merge conflicts. |
In function arguments and let bindings, do not suggest changing `C` to `Foo::C` unless `C` is the only variant of `Foo`, because it won't work. The general warning is still kept, because code like this is confusing. Fixes rust-lang#88730
f514884
to
6e973f0
Compare
@davidtwco I had to rebase this, because some pattern matching machinery changed. |
@bors r+ |
📌 Commit 6e973f0 has been approved by |
…ariant-match, r=davidtwco fix(lint): don't suggest refutable patterns to "fix" irrefutable bind In function arguments and let bindings, do not suggest changing `C` to `Foo::C` unless `C` is the only variant of `Foo`, because it won't work. The general warning is still kept, because code like this is confusing. Fixes rust-lang#88730 p.s. `src/test/ui/lint/lint-uppercase-variables.rs` already tests the one-variant case.
…ariant-match, r=davidtwco fix(lint): don't suggest refutable patterns to "fix" irrefutable bind In function arguments and let bindings, do not suggest changing `C` to `Foo::C` unless `C` is the only variant of `Foo`, because it won't work. The general warning is still kept, because code like this is confusing. Fixes rust-lang#88730 p.s. `src/test/ui/lint/lint-uppercase-variables.rs` already tests the one-variant case.
…ariant-match, r=davidtwco fix(lint): don't suggest refutable patterns to "fix" irrefutable bind In function arguments and let bindings, do not suggest changing `C` to `Foo::C` unless `C` is the only variant of `Foo`, because it won't work. The general warning is still kept, because code like this is confusing. Fixes rust-lang#88730 p.s. `src/test/ui/lint/lint-uppercase-variables.rs` already tests the one-variant case.
…arth Rollup of 8 pull requests Successful merges: - rust-lang#88782 (Fix ICE when `start` lang item has wrong generics) - rust-lang#89202 (Resolve infered types when complaining about unexpected call type ) - rust-lang#89248 (Suggest similarly named associated items in trait impls) - rust-lang#89303 (Add `#[must_not_suspend]` to some types in std) - rust-lang#89306 (thread: implements available_concurrency on haiku) - rust-lang#89314 (fix(lint): don't suggest refutable patterns to "fix" irrefutable bind) - rust-lang#89370 (CTFE: tweak aggregate rvalue handling) - rust-lang#89392 (bootstrap: Update comment in config.library.toml.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
In function arguments and let bindings, do not suggest changing
C
toFoo::C
unlessC
is the only variant ofFoo
, because it won't work.The general warning is still kept, because code like this is confusing.
Fixes #88730
p.s.
src/test/ui/lint/lint-uppercase-variables.rs
already tests the one-variant case.