forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#61446 - czipperz:nll-unused_mut, r=matthewj…
…asper On TerminatorKind::DropAndReplace still handle unused_mut correctly Closes rust-lang#61424 - [x] Todo add regression test
- Loading branch information
Showing
3 changed files
with
41 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#![deny(unused_mut)] | ||
|
||
fn main() { | ||
let mut x; //~ ERROR: variable does not need to be mutable | ||
x = String::new(); | ||
dbg!(x); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error: variable does not need to be mutable | ||
--> $DIR/issue-61424.rs:4:9 | ||
| | ||
LL | let mut x; | ||
| ----^ | ||
| | | ||
| help: remove this `mut` | ||
| | ||
note: lint level defined here | ||
--> $DIR/issue-61424.rs:1:9 | ||
| | ||
LL | #![deny(unused_mut)] | ||
| ^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|