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() {
|
2017-11-27 02:07:58 -06:00
|
|
|
let v: isize = 1; //[ast]~ NOTE first assignment
|
|
|
|
//[mir]~^ NOTE first assignment
|
2018-09-12 13:13:40 -05:00
|
|
|
//[mir]~| HELP make this binding mutable
|
|
|
|
//[mir]~| SUGGESTION mut v
|
2013-07-02 14:47:32 -05:00
|
|
|
v.clone();
|
2017-11-27 02:07:58 -06:00
|
|
|
v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
|
|
|
|
//[mir]~^ ERROR cannot assign twice to immutable variable `v`
|
|
|
|
//[ast]~| NOTE cannot assign twice to immutable
|
|
|
|
//[mir]~| NOTE cannot assign twice to immutable
|
2013-07-02 14:47:32 -05:00
|
|
|
v.clone();
|
2012-05-23 22:53:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|