Open
Description
Code:
fn main() {
let mut point = &mut Point { x: 10, y: 20};
point.x = 30;
println!("{:?}", point);
}
#[derive(Debug)]
struct Point {
x: i32,
y: i32,
}
Current behavior:
no warning
Expected behavior:
warning: variable does not need to be mutable
--> src/main.rs:2:13
|
2 | let mut point = &mut Point { x: 10, y: 20};
| ----^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default