]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.stderr
Auto merge of #59887 - eddyb:safer-metadata, r=Zoxc
[rust.git] / src / test / ui / borrowck / borrowck-for-loop-correct-cmt-for-pattern.stderr
1 error[E0507]: cannot move out of borrowed content
2   --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:12:15
3    |
4 LL |     for &a in x.iter() {
5    |         --    ^^^^^^^^ cannot move out of borrowed content
6    |         ||
7    |         |data moved here
8    |         help: consider removing the `&`: `a`
9    |
10 note: move occurs because `a` has type `&mut i32`, which does not implement the `Copy` trait
11   --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:12:10
12    |
13 LL |     for &a in x.iter() {
14    |          ^
15
16 error[E0507]: cannot move out of borrowed content
17   --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:18:15
18    |
19 LL |     for &a in &f.a {
20    |         --    ^^^^ cannot move out of borrowed content
21    |         ||
22    |         |data moved here
23    |         help: consider removing the `&`: `a`
24    |
25 note: move occurs because `a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
26   --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:18:10
27    |
28 LL |     for &a in &f.a {
29    |          ^
30
31 error[E0507]: cannot move out of borrowed content
32   --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:15
33    |
34 LL |     for &a in x.iter() {
35    |         --    ^^^^^^^^ cannot move out of borrowed content
36    |         ||
37    |         |data moved here
38    |         help: consider removing the `&`: `a`
39    |
40 note: move occurs because `a` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
41   --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:10
42    |
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`.