Skip to content

Commit fea2cdb

Browse files
committed
Use a type implementing Drop
1 parent 7feeaf0 commit fea2cdb

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/test/ui/nll/issue-61424.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
fn main() {
44
let mut x; //~ ERROR: variable does not need to be mutable
5-
x = 0;
6-
dbg!(0);
5+
x = String::new();
6+
dbg!(x);
77
}

src/test/ui/nll/issue-61424.stderr

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error: variable does not need to be mutable
2+
--> $DIR/issue-61424.rs:4:9
3+
|
4+
LL | let mut x;
5+
| ----^
6+
| |
7+
| help: remove this `mut`
8+
|
9+
note: lint level defined here
10+
--> $DIR/issue-61424.rs:1:9
11+
|
12+
LL | #![deny(unused_mut)]
13+
| ^^^^^^^^^^
14+
15+
error: aborting due to previous error
16+

0 commit comments

Comments
 (0)