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