|
| 1 | +error[E0382]: use of moved value: `x` |
| 2 | + --> $DIR/move-guard-if-let-chain.rs:12:27 |
| 3 | + | |
| 4 | +LL | let x: Box<_> = Box::new(1); |
| 5 | + | - move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait |
| 6 | +... |
| 7 | +LL | (1, 2) if let y = x && c => (), |
| 8 | + | - value moved here |
| 9 | +LL | (1, 2) if let z = x => (), |
| 10 | + | ^ value used here after move |
| 11 | + | |
| 12 | +help: borrow this binding in the pattern to avoid moving the value |
| 13 | + | |
| 14 | +LL | (1, 2) if let ref y = x && c => (), |
| 15 | + | +++ |
| 16 | + |
| 17 | +error[E0382]: use of moved value: `x` |
| 18 | + --> $DIR/move-guard-if-let-chain.rs:36:27 |
| 19 | + | |
| 20 | +LL | let x: Box<_> = Box::new(1); |
| 21 | + | - move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait |
| 22 | +... |
| 23 | +LL | (1, _) if let y = x && c => (), |
| 24 | + | - value moved here |
| 25 | +LL | (_, 2) if let z = x => (), |
| 26 | + | ^ value used here after move |
| 27 | + | |
| 28 | +help: borrow this binding in the pattern to avoid moving the value |
| 29 | + | |
| 30 | +LL | (1, _) if let ref y = x && c => (), |
| 31 | + | +++ |
| 32 | + |
| 33 | +error[E0382]: use of moved value: `x` |
| 34 | + --> $DIR/move-guard-if-let-chain.rs:59:36 |
| 35 | + | |
| 36 | +LL | let x: Box<_> = Box::new(1); |
| 37 | + | - move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait |
| 38 | +... |
| 39 | +LL | (1, _) | (_, 2) if let y = x && c => (), |
| 40 | + | - ^ value used here after move |
| 41 | + | | |
| 42 | + | value moved here |
| 43 | + | |
| 44 | +help: borrow this binding in the pattern to avoid moving the value |
| 45 | + | |
| 46 | +LL | (1, _) | (_, 2) if let ref y = x && c => (), |
| 47 | + | +++ |
| 48 | + |
| 49 | +error[E0382]: use of moved value: `x` |
| 50 | + --> $DIR/move-guard-if-let-chain.rs:82:16 |
| 51 | + | |
| 52 | +LL | let x: Box<_> = Box::new(1); |
| 53 | + | - move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait |
| 54 | +... |
| 55 | +LL | (1, 2) if let y = x && c => false, |
| 56 | + | - value moved here |
| 57 | +LL | _ => { *x == 1 }, |
| 58 | + | ^^ value used here after move |
| 59 | + | |
| 60 | +help: borrow this binding in the pattern to avoid moving the value |
| 61 | + | |
| 62 | +LL | (1, 2) if let ref y = x && c => false, |
| 63 | + | +++ |
| 64 | + |
| 65 | +error: aborting due to 4 previous errors |
| 66 | + |
| 67 | +For more information about this error, try `rustc --explain E0382`. |
0 commit comments