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