fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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