]> git.proxmox.com Git - rustc.git/blob - src/test/ui/moves/moves-based-on-type-access-to-field.stderr
New upstream version 1.47.0~beta.2+dfsg1
[rustc.git] / src / test / ui / moves / moves-based-on-type-access-to-field.stderr
1 error[E0382]: borrow of moved value: `x`
2 --> $DIR/moves-based-on-type-access-to-field.rs:11:12
3 |
4 LL | let x = vec!["hi".to_string()];
5 | - move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait
6 LL | consume(x.into_iter().next().unwrap());
7 | ----------- `x` moved due to this method call
8 LL | touch(&x[0]);
9 | ^ value borrowed here after move
10 |
11 note: this function consumes the receiver `self` by taking ownership of it, which moves `x`
12 --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
13 |
14 LL | fn into_iter(self) -> Self::IntoIter;
15 | ^^^^
16
17 error: aborting due to previous error
18
19 For more information about this error, try `rustc --explain E0382`.