2017-11-27 02:07:58 -06:00
|
|
|
// revisions: ast mir
|
|
|
|
//[mir]compile-flags: -Zborrowck=mir
|
|
|
|
|
2012-05-23 22:53:49 -05:00
|
|
|
fn test() {
|
2015-01-08 04:54:35 -06:00
|
|
|
let v: isize;
|
2018-09-12 13:13:40 -05:00
|
|
|
//[mir]~^ HELP make this binding mutable
|
|
|
|
//[mir]~| SUGGESTION mut v
|
2012-05-19 07:52:01 -05:00
|
|
|
loop {
|
2017-11-27 02:07:58 -06:00
|
|
|
v = 1; //[ast]~ ERROR cannot assign twice to immutable variable
|
|
|
|
//[mir]~^ ERROR cannot assign twice to immutable variable `v`
|
|
|
|
//[ast]~| NOTE cannot assign twice to immutable variable
|
|
|
|
//[mir]~| NOTE cannot assign twice to immutable variable
|
2013-07-02 14:47:32 -05:00
|
|
|
v.clone(); // just to prevent liveness warnings
|
2012-05-19 07:52:01 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|