-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 false negative for unused_mut
#110960
Merged
Merged
Conversation
This file contains 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
(rustbot has picked a reviewer for you, use r? to override) |
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Apr 28, 2023
compiler-errors
approved these changes
Apr 28, 2023
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.
Makes sense, just moving the used_mut
only onto the path where the error reporting is actually happening.
@bors r+ |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Apr 28, 2023
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Apr 28, 2023
…errors fix false negative for `unused_mut` fixes rust-lang#110849 We want to avoid double diagnostics for code like this, but only if an error actually occurs: ```rust fn main() { let mut x: (i32, i32); x.0 = 1; } ``` The first commit fixes the lint and the second one removes all the unused `mut`s it found.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 28, 2023
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#110877 (Provide better type hints when a type doesn't support a binary operator) - rust-lang#110917 (only error combining +whole-archive and +bundle for rlibs) - rust-lang#110921 (Use `NonNull::new_unchecked` and `NonNull::len` in `rustc_arena`.) - rust-lang#110927 (Encoder/decoder cleanups) - rust-lang#110944 (share BinOp::Offset between CTFE and Miri) - rust-lang#110948 (run-make test: using single quotes to not trigger the shell) - rust-lang#110957 (Fix an ICE in conflict error diagnostics) - rust-lang#110960 (fix false negative for `unused_mut`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang/cargo
that referenced
this pull request
May 1, 2023
Fix warning with unused mut ### What does this PR try to resolve? ``` warning: variable does not need to be mutable --> src/cargo/core/compiler/unit_dependencies.rs:152:5 | 152 | mut state: &mut State<'_, '_>, | ----^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default warning: `cargo` (lib) generated 1 warning (run `cargo fix --lib -p cargo` to apply 1 suggestion) ``` This is caused by rust-lang/rust#110960 ### How should we test and review this PR? Running the mainline rust toolchain and `cargo build` without any wanrning messages would look like the above. ### Additional information None
charles-r-earp
pushed a commit
to charles-r-earp/cargo
that referenced
this pull request
May 3, 2023
This is caused by rust-lang/rust#110960
ehuss
added a commit
to ehuss/git2-rs
that referenced
this pull request
May 5, 2023
A false negative for unused_mut was fixed in rust-lang/rust#110960.
weihanglo
pushed a commit
to weihanglo/cargo
that referenced
this pull request
May 23, 2023
This is caused by rust-lang/rust#110960
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
fixes #110849
We want to avoid double diagnostics for code like this, but only if an error actually occurs:
The first commit fixes the lint and the second one removes all the unused
mut
s it found.