]> git.proxmox.com Git - rustc.git/blob - tests/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / borrowck / borrowck-for-loop-correct-cmt-for-pattern.stderr
1 error[E0507]: cannot move out of a shared reference
2 --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:12:15
3 |
4 LL | for &a in x.iter() {
5 | - ^^^^^^^^
6 | |
7 | data moved here
8 | move occurs because `a` has type `&mut i32`, which does not implement the `Copy` trait
9 |
10 help: consider removing the borrow
11 |
12 LL - for &a in x.iter() {
13 LL + for a in x.iter() {
14 |
15
16 error[E0507]: cannot move out of a shared reference
17 --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:18:15
18 |
19 LL | for &a in &f.a {
20 | - ^^^^
21 | |
22 | data moved here
23 | move occurs because `a` has type `Box<isize>`, which does not implement the `Copy` trait
24 |
25 help: consider removing the borrow
26 |
27 LL - for &a in &f.a {
28 LL + for a in &f.a {
29 |
30
31 error[E0507]: cannot move out of a shared reference
32 --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:15
33 |
34 LL | for &a in x.iter() {
35 | - ^^^^^^^^
36 | |
37 | data moved here
38 | move occurs because `a` has type `Box<i32>`, which does not implement the `Copy` trait
39 |
40 help: consider removing the borrow
41 |
42 LL - for &a in x.iter() {
43 LL + for a in x.iter() {
44 |
45
46 error: aborting due to 3 previous errors
47
48 For more information about this error, try `rustc --explain E0507`.