summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-27282-move-match-input-into-guard.stderr
blob: ae7978004576b886be6cdad5b065fe2d5d307f2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
error[E0382]: use of moved value: `b`
  --> $DIR/issue-27282-move-match-input-into-guard.rs:14:5
   |
LL |     let b = &mut true;
   |         - move occurs because `b` has type `&mut bool`, which does not implement the `Copy` trait
LL |     match b {
   |     ^^^^^^^ value used here after move
...
LL |         _ if { (|| { let bar = b; *bar = false; })();
   |                 --             - variable moved due to use in closure
   |                 |
   |                 value moved into closure here

error[E0382]: use of moved value: `b`
  --> $DIR/issue-27282-move-match-input-into-guard.rs:24:5
   |
LL |     let b = &mut true;
   |         - move occurs because `b` has type `&mut bool`, which does not implement the `Copy` trait
LL |     match b {
   |     ^^^^^^^ value used here after move
...
LL |             (|| { let bar = b; *bar = false; })();
   |              --             - variable moved due to use in closure
   |              |
   |              value moved into closure here

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0382`.