fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
1.4 KiB33 linesraw
1error[E0382]: assign to part of moved value: `t`
2  --> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:13:9
3   |
4LL |         let mut t: Tuple = (S(0), 0);
5   |             ----- move occurs because `t` has type `(S, i32)`, which does not implement the `Copy` trait
6LL |         drop(t);
7   |              - value moved here
8LL |         t.0 = S(1);
9   |         ^^^^^^^^^^ value partially assigned here after move
10
11error[E0382]: assign to part of moved value: `u`
12  --> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:22:9
13   |
14LL |         let mut u: Tpair = Tpair(S(0), 0);
15   |             ----- move occurs because `u` has type `Tpair`, which does not implement the `Copy` trait
16LL |         drop(u);
17   |              - value moved here
18LL |         u.0 = S(1);
19   |         ^^^^^^^^^^ value partially assigned here after move
20
21error[E0382]: assign to part of moved value: `v`
22  --> $DIR/issue-54499-field-mutation-of-moved-out-with-mut.rs:31:9
23   |
24LL |         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
26LL |         drop(v);
27   |              - value moved here
28LL |         v.x = S(1);
29   |         ^^^^^^^^^^ value partially assigned here after move
30
31error: aborting due to 3 previous errors
32
33For more information about this error, try `rustc --explain E0382`.