]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/issue-53114-borrow-checks.stderr
Rollup merge of #104793 - nicholasbishop:bishop-add-efiapi, r=JohnTitor
[rust.git] / src / test / ui / binding / issue-53114-borrow-checks.stderr
1 error[E0382]: use of moved value: `m`
2   --> $DIR/issue-53114-borrow-checks.rs:22:11
3    |
4 LL |     let m = M;
5    |         - move occurs because `m` has type `M`, which does not implement the `Copy` trait
6 LL |     drop(m);
7    |          - value moved here
8 LL |     match m { _ => { } } // #53114: should eventually be accepted too
9    |           ^ value used here after move
10
11 error[E0382]: use of partially moved value: `mm`
12   --> $DIR/issue-53114-borrow-checks.rs:27:11
13    |
14 LL |     match mm { (_x, _) => { } }
15    |                 -- value partially moved here
16 LL |     match mm { (_, _y) => { } }
17    |           ^^ value used here after partial move
18    |
19    = note: partial move occurs because `mm.0` has type `M`, which does not implement the `Copy` trait
20 help: borrow this binding in the pattern to avoid moving the value
21    |
22 LL |     match mm { (ref _x, _) => { } }
23    |                 +++
24
25 error[E0382]: use of partially moved value: `mm`
26   --> $DIR/issue-53114-borrow-checks.rs:29:11
27    |
28 LL |     match mm { (_, _y) => { } }
29    |                    -- value partially moved here
30 LL |
31 LL |     match mm { (_, _) => { } }
32    |           ^^ value used here after partial move
33    |
34    = note: partial move occurs because `mm.1` has type `M`, which does not implement the `Copy` trait
35 help: borrow this binding in the pattern to avoid moving the value
36    |
37 LL |     match mm { (_, ref _y) => { } }
38    |                    +++
39
40 error[E0382]: use of moved value: `m`
41   --> $DIR/issue-53114-borrow-checks.rs:36:16
42    |
43 LL |     let m = M;
44    |         - move occurs because `m` has type `M`, which does not implement the `Copy` trait
45 LL |     drop(m);
46    |          - value moved here
47 LL |     if let _ = m { } // #53114: should eventually be accepted too
48    |                ^ value used here after move
49
50 error[E0382]: use of partially moved value: `mm`
51   --> $DIR/issue-53114-borrow-checks.rs:41:22
52    |
53 LL |     if let (_x, _) = mm { }
54    |             -- value partially moved here
55 LL |     if let (_, _y) = mm { }
56    |                      ^^ value used here after partial move
57    |
58    = note: partial move occurs because `mm.0` has type `M`, which does not implement the `Copy` trait
59 help: borrow this binding in the pattern to avoid moving the value
60    |
61 LL |     if let (ref _x, _) = mm { }
62    |             +++
63
64 error[E0382]: use of partially moved value: `mm`
65   --> $DIR/issue-53114-borrow-checks.rs:43:21
66    |
67 LL |     if let (_, _y) = mm { }
68    |                -- value partially moved here
69 LL |
70 LL |     if let (_, _) = mm { }
71    |                     ^^ value used here after partial move
72    |
73    = note: partial move occurs because `mm.1` has type `M`, which does not implement the `Copy` trait
74 help: borrow this binding in the pattern to avoid moving the value
75    |
76 LL |     if let (_, ref _y) = mm { }
77    |                +++
78
79 error: aborting due to 6 previous errors
80
81 For more information about this error, try `rustc --explain E0382`.