]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-64559.stderr
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[rust.git] / src / test / ui / issues / issue-64559.stderr
1 error[E0382]: use of moved value: `orig`
2   --> $DIR/issue-64559.rs:4:20
3    |
4 LL |     let orig = vec![true];
5    |         ---- move occurs because `orig` has type `Vec<bool>`, which does not implement the `Copy` trait
6 LL |     for _val in orig {}
7    |                 ----
8    |                 |
9    |                 `orig` moved due to this implicit call to `.into_iter()`
10    |                 help: consider borrowing to avoid moving into the for loop: `&orig`
11 LL |     let _closure = || orig;
12    |                    ^^ ---- use occurs due to use in closure
13    |                    |
14    |                    value used here after move
15    |
16 note: this function takes ownership of the receiver `self`, which moves `orig`
17   --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
18    |
19 LL |     fn into_iter(self) -> Self::IntoIter;
20    |                  ^^^^
21
22 error: aborting due to previous error
23
24 For more information about this error, try `rustc --explain E0382`.