]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issue-27282-move-match-input-into-guard.stderr
Rollup merge of #52771 - matklad:patch-1, r=kennytm
[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    |           - borrow of `b` occurs here
6 LL |         &mut false => {},
7 LL |         _ if { (|| { let bar = b; *bar = false; })();
8    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move out of `b` occurs here
9 ...
10 LL |         &mut true => { println!("You might think we should get here"); },
11    |         --------- borrow later used here
12
13 error[E0382]: use of moved value: `*b`
14   --> $DIR/issue-27282-move-match-input-into-guard.rs:29:14
15    |
16 LL |         _ if { (|| { let bar = b; *bar = false; })();
17    |                ----------------------------------- value moved here
18 ...
19 LL |         &mut true => { println!("You might think we should get here"); },
20    |              ^^^^ value used here after move
21
22 error: aborting due to 2 previous errors
23
24 Some errors occurred: E0382, E0505.
25 For more information about an error, try `rustc --explain E0382`.