2012-05-19 05:52:01 -07:00
|
|
|
fn test1() {
|
|
|
|
let v: int;
|
|
|
|
let mut w: int;
|
2012-06-30 12:23:59 +01:00
|
|
|
v = 1; //~ NOTE prior assignment occurs here
|
2012-05-19 05:52:01 -07:00
|
|
|
w = 2;
|
2012-06-30 12:23:59 +01:00
|
|
|
v <-> w; //~ ERROR re-assignment of immutable variable
|
2012-05-19 05:52:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test2() {
|
|
|
|
let v: int;
|
|
|
|
let mut w: int;
|
2012-06-30 12:23:59 +01:00
|
|
|
v = 1; //~ NOTE prior assignment occurs here
|
2012-05-19 05:52:01 -07:00
|
|
|
w = 2;
|
2012-06-30 12:23:59 +01:00
|
|
|
w <-> v; //~ ERROR re-assignment of immutable variable
|
2012-05-19 05:52:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|