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