We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
fn x() -> i32 { let mut a : i32 = 4; a = 5; a }
warning: value assigned to a is never read, #[warn(unused_assignments)] on by default
a
fn y(mut a: i32) -> i32 { a = 3; a }
Does not warn, even though it has pretty much the same problem. In this case, the value passed in is never used.