fix(lint): don't suggest refutable patterns to "fix" irrefutable bind#89314
Merged
bors merged 1 commit intorust-lang:masterfrom Oct 1, 2021
Merged
Conversation
Contributor
|
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
3d4ccfb to
f514884
Compare
Member
|
@bors r+ |
Collaborator
|
📌 Commit f5148848e579836251720804a5b3725cd8772d5a has been approved by |
Collaborator
|
☔ 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
Contributor
Author
|
@davidtwco I had to rebase this, because some pattern matching machinery changed. |
Member
|
@bors r+ |
Collaborator
|
📌 Commit 6e973f0 has been approved by |
ehuss
added a commit
to ehuss/rust
that referenced
this pull request
Sep 30, 2021
…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.
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Sep 30, 2021
…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.
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Sep 30, 2021
…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.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 1, 2021
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In function arguments and let bindings, do not suggest changing
CtoFoo::CunlessCis 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.rsalready tests the one-variant case.