File tree Expand file tree Collapse file tree 6 files changed +8
-1
lines changed Expand file tree Collapse file tree 6 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1313
1414fn test ( ) {
1515 let v: isize ;
16+ //[mir]~^ NOTE consider changing this to `mut v`
1617 v = 1 ; //[ast]~ NOTE first assignment
1718 //[mir]~^ NOTE first assignment
1819 println ! ( "v={}" , v) ;
Original file line number Diff line number Diff line change 1313
1414fn test_drop_replace ( ) {
1515 let b: Box < isize > ;
16+ //[mir]~^ NOTE consider changing this to `mut b`
1617 b = Box :: new ( 1 ) ; //[ast]~ NOTE first assignment
1718 //[mir]~^ NOTE first assignment
1819 b = Box :: new ( 2 ) ; //[ast]~ ERROR cannot assign twice to immutable variable
@@ -24,14 +25,15 @@ fn test_drop_replace() {
2425fn test_call ( ) {
2526 let b = Box :: new ( 1 ) ; //[ast]~ NOTE first assignment
2627 //[mir]~^ NOTE first assignment
28+ //[mir]~| NOTE consider changing this to `mut b`
2729 b = Box :: new ( 2 ) ; //[ast]~ ERROR cannot assign twice to immutable variable
2830 //[mir]~^ ERROR cannot assign twice to immutable variable `b`
2931 //[ast]~| NOTE cannot assign twice to immutable
3032 //[mir]~| NOTE cannot assign twice to immutable
3133}
3234
3335fn test_args ( b : Box < i32 > ) { //[ast]~ NOTE first assignment
34- //[mir]~^ NOTE argument not declared as `mut`
36+ //[mir]~^ NOTE consider changing this to `mut b `
3537 b = Box :: new ( 2 ) ; //[ast]~ ERROR cannot assign twice to immutable variable
3638 //[mir]~^ ERROR cannot assign to immutable argument `b`
3739 //[ast]~| NOTE cannot assign twice to immutable
Original file line number Diff line number Diff line change 1313
1414fn test ( ) {
1515 let v: isize ;
16+ //[mir]~^ NOTE consider changing this to `mut v`
1617 loop {
1718 v = 1 ; //[ast]~ ERROR cannot assign twice to immutable variable
1819 //[mir]~^ ERROR cannot assign twice to immutable variable `v`
Original file line number Diff line number Diff line change 1313
1414fn test ( ) {
1515 let v: isize ;
16+ //[mir]~^ NOTE consider changing this to `mut v`
1617 v = 2 ; //[ast]~ NOTE first assignment
1718 //[mir]~^ NOTE first assignment
1819 v += 1 ; //[ast]~ ERROR cannot assign twice to immutable variable
Original file line number Diff line number Diff line change 1414fn test ( ) {
1515 let b = Box :: new ( 1 ) ; //[ast]~ NOTE first assignment
1616 //[mir]~^ NOTE first assignment
17+ //[mir]~| NOTE consider changing this to `mut b`
1718 drop ( b) ;
1819 b = Box :: new ( 2 ) ; //[ast]~ ERROR cannot assign twice to immutable variable
1920 //[mir]~^ ERROR cannot assign twice to immutable variable `b`
Original file line number Diff line number Diff line change 1414fn test ( ) {
1515 let v: isize = 1 ; //[ast]~ NOTE first assignment
1616 //[mir]~^ NOTE first assignment
17+ //[mir]~| NOTE consider changing this to `mut v`
1718 v. clone ( ) ;
1819 v = 2 ; //[ast]~ ERROR cannot assign twice to immutable variable
1920 //[mir]~^ ERROR cannot assign twice to immutable variable `v`
You can’t perform that action at this time.
0 commit comments