Warn unused_assignments for arguments

This commit is contained in:
Seo Sanghyeon 2015-11-03 19:04:36 +09:00
parent b7fbfb658e
commit 61e5b6dfdb
2 changed files with 26 additions and 4 deletions

View file

@ -27,4 +27,14 @@ fn f3() {
x = 4; //~ ERROR: value assigned to `x` is never read
}
fn f4(mut x: i32) { //~ ERROR: value passed to `x` is never read
x = 4;
x.clone();
}
fn f5(mut x: i32) {
x.clone();
x = 4; //~ ERROR: value assigned to `x` is never read
}
fn main() {}