2012-10-05 16:58:42 -05:00
|
|
|
fn f1(x: &mut int) {
|
|
|
|
*x = 1; // no error
|
2012-05-23 22:53:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn f2() {
|
2012-06-30 06:23:59 -05:00
|
|
|
let mut x = 3; //~ WARNING value assigned to `x` is never read
|
2012-05-23 22:53:49 -05:00
|
|
|
x = 4;
|
|
|
|
copy x;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn f3() {
|
|
|
|
let mut x = 3;
|
|
|
|
copy x;
|
2012-06-30 06:23:59 -05:00
|
|
|
x = 4; //~ WARNING value assigned to `x` is never read
|
2012-05-23 22:53:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { // leave this in here just to trigger compile-fail:
|
|
|
|
let x: int;
|
2012-06-30 06:23:59 -05:00
|
|
|
copy x; //~ ERROR use of possibly uninitialized variable: `x`
|
2012-05-23 22:53:49 -05:00
|
|
|
}
|