]> git.lizzy.rs Git - rust.git/blob - src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.stderr
Auto merge of #73660 - flip1995:clippyup, r=nikomatsakis
[rust.git] / src / test / ui / moves / moves-based-on-type-distribute-copy-over-paren.stderr
1 error[E0382]: borrow of moved value: `x`
2   --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:12:11
3    |
4 LL |     let x = "hi".to_string();
5    |         - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
6 LL |
7 LL |     let _y = Foo { f:x };
8    |                      - value moved here
9 LL |
10 LL |     touch(&x);
11    |           ^^ value borrowed here after move
12
13 error[E0382]: borrow of moved value: `x`
14   --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:21:11
15    |
16 LL |     let x = "hi".to_string();
17    |         - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
18 LL |
19 LL |     let _y = Foo { f:(((x))) };
20    |                      ------- value moved here
21 LL |
22 LL |     touch(&x);
23    |           ^^ value borrowed here after move
24
25 error: aborting due to 2 previous errors
26
27 For more information about this error, try `rustc --explain E0382`.