-
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
"variable does not need to be mutable" not detected #61424
Comments
The warning appears again if you switch to 2015 edition. Huh. Nice catch! |
I found that Stable 2015 edition produces the warning and everything else doesn't.
|
cc @matthewjasper (likely caused by NLL migrate mode, which was enabled in #59114 for the 2015 edition) |
Yes, looks like another nll bug. If someone wants to have a go at this, the issue is that we are treating DropAndReplace differently to Assign for the purposes of this lint. |
I can try doing it I just don't know here to begin. |
@czipperz I don't know this code too well, but take a look at |
Makes sense thank you. I was looking at librustc_lint and couldn't find anything. |
…asper On TerminatorKind::DropAndReplace still handle unused_mut correctly Closes rust-lang#61424 - [x] Todo add regression test
…asper On TerminatorKind::DropAndReplace still handle unused_mut correctly Closes rust-lang#61424 - [x] Todo add regression test
…asper On TerminatorKind::DropAndReplace still handle unused_mut correctly Closes rust-lang#61424 - [x] Todo add regression test
(sorry if this is an duplicate or the wrong repo 😇 )
(Playground)
Current behavior:
no warning
Expected behavior:
The variable clearly doesn't need to be mutable, still, nothing is detected and no warning is emitted.
Rust 1.35.0
(Using the playground, also in
1.37.0-nightly
(2019-05-31 7840a0b753a065a41999
))The text was updated successfully, but these errors were encountered: