]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issue-27282-move-match-input-into-guard.stderr
Rollup merge of #51158 - ogham:patch-1, r=steveklabnik
[rust.git] / src / test / ui / issue-27282-move-match-input-into-guard.stderr
1 error[E0505]: cannot move out of `b` because it is borrowed
2   --> $DIR/issue-27282-move-match-input-into-guard.rs:26:16
3    |
4 LL |        match b {
5    |   _____-
6    |  |_____|
7    | ||
8 LL | ||         &mut false => {},
9 LL | ||         _ if { (|| { let bar = b; *bar = false; })();
10    | ||                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move out of `b` occurs here
11 LL | ||                      //~^ ERROR cannot move out of `b` because it is borrowed [E0505]
12 ...  ||
13 LL | ||         _ => panic!("surely we could never get here, since rustc warns it is unreachable."),
14 LL | ||     }
15    | ||     -
16    | ||_____|
17    | |______borrow of `b` occurs here
18    |        borrow later used here
19
20 error[E0382]: use of moved value: `*b`
21   --> $DIR/issue-27282-move-match-input-into-guard.rs:29:14
22    |
23 LL |         _ if { (|| { let bar = b; *bar = false; })();
24    |                ----------------------------------- value moved here
25 ...
26 LL |         &mut true => { println!("You might think we should get here"); },
27    |              ^^^^ value used here after move
28
29 error: aborting due to 2 previous errors
30
31 Some errors occurred: E0382, E0505.
32 For more information about an error, try `rustc --explain E0382`.