]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/issue-27282-move-match-input-into-guard.stderr
Auto merge of #53002 - QuietMisdreavus:brother-may-i-have-some-loops, r=pnkfelix
[rust.git] / src / test / ui / issue-27282-move-match-input-into-guard.stderr
index f89388f1738ead329beae9b062c429d1035c4fd0..91c51bcd0582502f20de9d41e8ebd434d9cc2a60 100644 (file)
@@ -1,27 +1,24 @@
 error[E0505]: cannot move out of `b` because it is borrowed
-  --> $DIR/issue-27282-move-match-input-into-guard.rs:26:16
+  --> $DIR/issue-27282-move-match-input-into-guard.rs:26:17
    |
-LL |        match b {
-   |   _____-
-   |  |_____|
-   | ||
-LL | ||         &mut false => {},
-LL | ||         _ if { (|| { let bar = b; *bar = false; })();
-   | ||                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move out of `b` occurs here
-LL | ||                      //~^ ERROR cannot move out of `b` because it is borrowed [E0505]
-...  ||
-LL | ||         _ => panic!("surely we could never get here, since rustc warns it is unreachable."),
-LL | ||     }
-   | ||     -
-   | ||_____|
-   | |______borrow of `b` occurs here
-   |        borrow later used here
+LL |     match b {
+   |           - borrow of `b` occurs here
+LL |         &mut false => {},
+LL |         _ if { (|| { let bar = b; *bar = false; })();
+   |                 ^^             - move occurs due to use in closure
+   |                 |
+   |                 move out of `b` occurs here
+...
+LL |         &mut true => { println!("You might think we should get here"); },
+   |         --------- borrow later used here
 
 error[E0382]: use of moved value: `*b`
   --> $DIR/issue-27282-move-match-input-into-guard.rs:29:14
    |
 LL |         _ if { (|| { let bar = b; *bar = false; })();
-   |                ----------------------------------- value moved here
+   |                 --             - variable moved due to use in closure
+   |                 |
+   |                 value moved into closure here
 ...
 LL |         &mut true => { println!("You might think we should get here"); },
    |              ^^^^ value used here after move