]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-54499-field-mutation-of-moved-out-with-mut.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-54499-field-mutation-of-moved-out-with-mut.stderr
1 error[E0382]: assign to part of moved value: `t`
2   --> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:13:9
3    |
4 LL |         let mut t: Tuple = (S(0), 0);
5    |             ----- move occurs because `t` has type `(S, i32)`, which does not implement the `Copy` trait
6 LL |         drop(t);
7    |              - value moved here
8 LL |         t.0 = S(1);
9    |         ^^^^^^^^^^ value partially assigned here after move
10
11 error[E0382]: assign to part of moved value: `u`
12   --> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:22:9
13    |
14 LL |         let mut u: Tpair = Tpair(S(0), 0);
15    |             ----- move occurs because `u` has type `Tpair`, which does not implement the `Copy` trait
16 LL |         drop(u);
17    |              - value moved here
18 LL |         u.0 = S(1);
19    |         ^^^^^^^^^^ value partially assigned here after move
20
21 error[E0382]: assign to part of moved value: `v`
22   --> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:31:9
23    |
24 LL |         let mut v: Spair = Spair { x: S(0), y: 0 };
25    |             ----- move occurs because `v` has type `Spair`, which does not implement the `Copy` trait
26 LL |         drop(v);
27    |              - value moved here
28 LL |         v.x = S(1);
29    |         ^^^^^^^^^^ value partially assigned here after move
30
31 error: aborting due to 3 previous errors
32
33 For more information about this error, try `rustc --explain E0382`.