]> git.lizzy.rs Git - rust.git/commitdiff
Update the existing compile-fail tests to reflect diagnostic changes in NLL.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Fri, 15 Jun 2018 03:49:53 +0000 (05:49 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Tue, 19 Jun 2018 17:41:54 +0000 (19:41 +0200)
src/test/compile-fail/assign-imm-local-twice.rs
src/test/compile-fail/issue-45199.rs
src/test/compile-fail/liveness-assign-imm-local-in-loop.rs
src/test/compile-fail/liveness-assign-imm-local-in-op-eq.rs
src/test/compile-fail/liveness-assign-imm-local-with-drop.rs
src/test/compile-fail/liveness-assign-imm-local-with-init.rs

index d5e412c3745e0e50030b289ed799126ea52d0040..ee9dafdd49eb86c897d6ed4672ff8dd0d54e5248 100644 (file)
@@ -13,6 +13,7 @@
 
 fn test() {
     let v: isize;
+    //[mir]~^ NOTE consider changing this to `mut v`
     v = 1; //[ast]~ NOTE first assignment
            //[mir]~^ NOTE first assignment
     println!("v={}", v);
index ecddb4c101fdf7f89d26008f9ff4768dc2e513fd..61e19ffc0d293b7db19a27131db79728eddaecb5 100644 (file)
@@ -13,6 +13,7 @@
 
 fn test_drop_replace() {
     let b: Box<isize>;
+    //[mir]~^ NOTE consider changing this to `mut b`
     b = Box::new(1);    //[ast]~ NOTE first assignment
                         //[mir]~^ NOTE first assignment
     b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable
@@ -24,6 +25,7 @@ fn test_drop_replace() {
 fn test_call() {
     let b = Box::new(1);    //[ast]~ NOTE first assignment
                             //[mir]~^ NOTE first assignment
+                            //[mir]~| NOTE consider changing this to `mut b`
     b = Box::new(2);        //[ast]~ ERROR cannot assign twice to immutable variable
                             //[mir]~^ ERROR cannot assign twice to immutable variable `b`
                             //[ast]~| NOTE cannot assign twice to immutable
@@ -31,7 +33,7 @@ fn test_call() {
 }
 
 fn test_args(b: Box<i32>) {  //[ast]~ NOTE first assignment
-                                //[mir]~^ NOTE argument not declared as `mut`
+                                //[mir]~^ NOTE consider changing this to `mut b`
     b = Box::new(2);            //[ast]~ ERROR cannot assign twice to immutable variable
                                 //[mir]~^ ERROR cannot assign to immutable argument `b`
                                 //[ast]~| NOTE cannot assign twice to immutable
index f28906ddb955fccd02f1d4e21a1cf9be1a1ffe4c..7bc3680ca772343b51bafa75f343847445487c0d 100644 (file)
@@ -13,6 +13,7 @@
 
 fn test() {
     let v: isize;
+    //[mir]~^ NOTE consider changing this to `mut v`
     loop {
         v = 1; //[ast]~ ERROR cannot assign twice to immutable variable
                //[mir]~^ ERROR cannot assign twice to immutable variable `v`
index 594cc0761214aa2fbd2892af7ae34d0c100fe1e8..7812cdd8684f6c773599909581afcb7db2c2498e 100644 (file)
@@ -13,6 +13,7 @@
 
 fn test() {
     let v: isize;
+    //[mir]~^ NOTE consider changing this to `mut v`
     v = 2;  //[ast]~ NOTE first assignment
             //[mir]~^ NOTE first assignment
     v += 1; //[ast]~ ERROR cannot assign twice to immutable variable
index b4fb33ca15e2660d77c0ef5a937e2ebed5311806..bb61a9037d906c9b80939e26350de5ca426c5b64 100644 (file)
@@ -14,6 +14,7 @@
 fn test() {
     let b = Box::new(1); //[ast]~ NOTE first assignment
                          //[mir]~^ NOTE first assignment
+                         //[mir]~| NOTE consider changing this to `mut b`
     drop(b);
     b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable
                      //[mir]~^ ERROR cannot assign twice to immutable variable `b`
index 7204b5d5f2e169e742f1c5d33c499418a71eed47..672e9fab83743b8bf7b668fa17029850878ace20 100644 (file)
@@ -14,6 +14,7 @@
 fn test() {
     let v: isize = 1; //[ast]~ NOTE first assignment
                       //[mir]~^ NOTE first assignment
+                      //[mir]~| NOTE consider changing this to `mut v`
     v.clone();
     v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
            //[mir]~^ ERROR cannot assign twice to immutable variable `v`