]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/borrow-for-loop-head.stderr
Rollup merge of #59432 - phansch:compiletest_docs, r=alexcrichton
[rust.git] / src / test / ui / suggestions / borrow-for-loop-head.stderr
1 error[E0505]: cannot move out of `a` because it is borrowed
2   --> $DIR/borrow-for-loop-head.rs:4:18
3    |
4 LL |     for i in &a {
5    |               - borrow of `a` occurs here
6 LL |         for j in a {
7    |                  ^ move out of `a` occurs here
8
9 error[E0382]: use of moved value: `a`
10   --> $DIR/borrow-for-loop-head.rs:4:18
11    |
12 LL |         for j in a {
13    |                  ^ value moved here in previous iteration of loop
14    |
15    = note: move occurs because `a` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
16 help: consider borrowing this to avoid moving it into the for loop
17    |
18 LL |         for j in &a {
19    |                  ^^
20
21 error: aborting due to 2 previous errors
22
23 Some errors occurred: E0382, E0505.
24 For more information about an error, try `rustc --explain E0382`.