fork/rust

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

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

master
2.7 KiB64 linesraw
1error[E0381]: assigned binding `d` isn't fully initialized
2  --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:28:5
3   |
4LL |     let d: D;
5   |         - binding declared here but left uninitialized
6LL |     d.x = 10;
7   |     ^^^^^^^^ `d` assigned here but it isn't fully initialized
8   |
9   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
10
11error[E0381]: assigned binding `d` isn't fully initialized
12  --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:33:5
13   |
14LL |     let mut d: D;
15   |         ----- binding declared here but left uninitialized
16LL |     d.x = 10;
17   |     ^^^^^^^^ `d` assigned here but it isn't fully initialized
18   |
19   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
20
21error[E0382]: assign of moved value: `d`
22  --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:39:5
23   |
24LL |     let mut d = D { x: 0, s: S{ y: 0, z: 0 } };
25   |         ----- move occurs because `d` has type `D`, which does not implement the `Copy` trait
26LL |     drop(d);
27   |          - value moved here
28LL |     d.x = 10;
29   |     ^^^^^^^^ value assigned here after move
30
31error[E0381]: partially assigned binding `d` isn't fully initialized
32  --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:45:5
33   |
34LL |     let d: D;
35   |         - binding declared here but left uninitialized
36LL |     d.s.y = 20;
37   |     ^^^^^^^^^^ `d.s` partially assigned here but it isn't fully initialized
38   |
39   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
40
41error[E0381]: partially assigned binding `d` isn't fully initialized
42  --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:50:5
43   |
44LL |     let mut d: D;
45   |         ----- binding declared here but left uninitialized
46LL |     d.s.y = 20;
47   |     ^^^^^^^^^^ `d.s` partially assigned here but it isn't fully initialized
48   |
49   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
50
51error[E0382]: assign to part of moved value: `d`
52  --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:56:5
53   |
54LL |     let mut d = D { x: 0, s: S{ y: 0, z: 0} };
55   |         ----- move occurs because `d` has type `D`, which does not implement the `Copy` trait
56LL |     drop(d);
57   |          - value moved here
58LL |     d.s.y = 20;
59   |     ^^^^^^^^^^ value partially assigned here after move
60
61error: aborting due to 6 previous errors
62
63Some errors have detailed explanations: E0381, E0382.
64For more information about an error, try `rustc --explain E0381`.