]> git.lizzy.rs Git - rust.git/blob - tests/ui/by-move-pattern-binding.stderr
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
[rust.git] / tests / ui / by-move-pattern-binding.stderr
1 error[E0507]: cannot move out of a shared reference
2   --> $DIR/by-move-pattern-binding.rs:14:11
3    |
4 LL |     match &s.x {
5    |           ^^^^
6 LL |         &E::Foo => {}
7 LL |         &E::Bar(identifier) => f(identifier.clone())
8    |                 ----------
9    |                 |
10    |                 data moved here
11    |                 move occurs because `identifier` has type `String`, which does not implement the `Copy` trait
12    |
13 help: consider removing the borrow
14    |
15 LL -         &E::Bar(identifier) => f(identifier.clone())
16 LL +         E::Bar(identifier) => f(identifier.clone())
17    |
18
19 error[E0507]: cannot move out of a shared reference
20   --> $DIR/by-move-pattern-binding.rs:22:34
21    |
22 LL |     if let &E::Bar(identifier) = &s.x {
23    |                    ----------    ^^^^
24    |                    |
25    |                    data moved here
26    |                    move occurs because `identifier` has type `String`, which does not implement the `Copy` trait
27    |
28 help: consider removing the borrow
29    |
30 LL -     if let &E::Bar(identifier) = &s.x {
31 LL +     if let E::Bar(identifier) = &s.x {
32    |
33
34 error[E0507]: cannot move out of a shared reference
35   --> $DIR/by-move-pattern-binding.rs:25:31
36    |
37 LL |     let &E::Bar(identifier) = &s.x else {
38    |                 ----------    ^^^^
39    |                 |
40    |                 data moved here
41    |                 move occurs because `identifier` has type `String`, which does not implement the `Copy` trait
42    |
43 help: consider removing the borrow
44    |
45 LL -     let &E::Bar(identifier) = &s.x else {
46 LL +     let E::Bar(identifier) = &s.x else {
47    |
48
49 error: aborting due to 3 previous errors
50
51 For more information about this error, try `rustc --explain E0507`.