]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-54499-field-mutation-of-moved-out.stderr
Auto merge of #95474 - oli-obk:tait_ub, r=jackh726
[rust.git] / src / test / ui / borrowck / issue-54499-field-mutation-of-moved-out.stderr
1 error[E0594]: cannot assign to `t.0`, as `t` is not declared as mutable
2   --> $DIR/issue-54499-field-mutation-of-moved-out.rs:13:9
3    |
4 LL |         let t: Tuple = (S(0), 0);
5    |             - help: consider changing this to be mutable: `mut t`
6 LL |         drop(t);
7 LL |         t.0 = S(1);
8    |         ^^^^^^^^^^ cannot assign
9
10 error[E0382]: assign to part of moved value: `t`
11   --> $DIR/issue-54499-field-mutation-of-moved-out.rs:13:9
12    |
13 LL |         let t: Tuple = (S(0), 0);
14    |             - move occurs because `t` has type `(S, i32)`, which does not implement the `Copy` trait
15 LL |         drop(t);
16    |              - value moved here
17 LL |         t.0 = S(1);
18    |         ^^^^^^^^^^ value partially assigned here after move
19
20 error[E0594]: cannot assign to `t.1`, as `t` is not declared as mutable
21   --> $DIR/issue-54499-field-mutation-of-moved-out.rs:16:9
22    |
23 LL |         let t: Tuple = (S(0), 0);
24    |             - help: consider changing this to be mutable: `mut t`
25 ...
26 LL |         t.1 = 2;
27    |         ^^^^^^^ cannot assign
28
29 error[E0594]: cannot assign to `u.0`, as `u` is not declared as mutable
30   --> $DIR/issue-54499-field-mutation-of-moved-out.rs:24:9
31    |
32 LL |         let u: Tpair = Tpair(S(0), 0);
33    |             - help: consider changing this to be mutable: `mut u`
34 LL |         drop(u);
35 LL |         u.0 = S(1);
36    |         ^^^^^^^^^^ cannot assign
37
38 error[E0382]: assign to part of moved value: `u`
39   --> $DIR/issue-54499-field-mutation-of-moved-out.rs:24:9
40    |
41 LL |         let u: Tpair = Tpair(S(0), 0);
42    |             - move occurs because `u` has type `Tpair`, which does not implement the `Copy` trait
43 LL |         drop(u);
44    |              - value moved here
45 LL |         u.0 = S(1);
46    |         ^^^^^^^^^^ value partially assigned here after move
47
48 error[E0594]: cannot assign to `u.1`, as `u` is not declared as mutable
49   --> $DIR/issue-54499-field-mutation-of-moved-out.rs:27:9
50    |
51 LL |         let u: Tpair = Tpair(S(0), 0);
52    |             - help: consider changing this to be mutable: `mut u`
53 ...
54 LL |         u.1 = 2;
55    |         ^^^^^^^ cannot assign
56
57 error[E0594]: cannot assign to `v.x`, as `v` is not declared as mutable
58   --> $DIR/issue-54499-field-mutation-of-moved-out.rs:35:9
59    |
60 LL |         let v: Spair = Spair { x: S(0), y: 0 };
61    |             - help: consider changing this to be mutable: `mut v`
62 LL |         drop(v);
63 LL |         v.x = S(1);
64    |         ^^^^^^^^^^ cannot assign
65
66 error[E0382]: assign to part of moved value: `v`
67   --> $DIR/issue-54499-field-mutation-of-moved-out.rs:35:9
68    |
69 LL |         let v: Spair = Spair { x: S(0), y: 0 };
70    |             - move occurs because `v` has type `Spair`, which does not implement the `Copy` trait
71 LL |         drop(v);
72    |              - value moved here
73 LL |         v.x = S(1);
74    |         ^^^^^^^^^^ value partially assigned here after move
75
76 error[E0594]: cannot assign to `v.y`, as `v` is not declared as mutable
77   --> $DIR/issue-54499-field-mutation-of-moved-out.rs:38:9
78    |
79 LL |         let v: Spair = Spair { x: S(0), y: 0 };
80    |             - help: consider changing this to be mutable: `mut v`
81 ...
82 LL |         v.y = 2;
83    |         ^^^^^^^ cannot assign
84
85 error: aborting due to 9 previous errors
86
87 Some errors have detailed explanations: E0382, E0594.
88 For more information about an error, try `rustc --explain E0382`.