blob: d84c9401e2577104bf8b2310d32cba437912b4d9 [file] [log] [blame]
// Note: it would be nice to give fewer warnings in these cases.
fn mutate_by_mut_ref(x: &mut uint) {
*x = 0;
}
fn mutate_by_ref(&&x: uint) {
//~^ WARNING unused variable: `x`
x = 0; //~ ERROR assigning to argument
}
fn mutate_by_val(++x: uint) {
//~^ WARNING unused variable: `x`
x = 0; //~ ERROR assigning to argument
}
fn mutate_by_copy(+x: uint) {
//~^ WARNING unused variable: `x`
x = 0; //~ ERROR assigning to argument
//~^ WARNING value assigned to `x` is never read
}
fn mutate_by_move(-x: uint) {
//~^ WARNING unused variable: `x`
x = 0; //~ ERROR assigning to argument
//~^ WARNING value assigned to `x` is never read
}
fn main() {
}