]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/issue-21232-partial-init-and-use.stderr
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / nll / issue-21232-partial-init-and-use.stderr
1 error[E0381]: partially assigned binding `s` isn't fully initialized
2   --> $DIR/issue-21232-partial-init-and-use.rs:97:5
3    |
4 LL |     let s: S<B>;
5    |         - binding declared here but left uninitialized
6 LL |     s.x = 10; s.y = Box::new(20);
7    |     ^^^^^^^^ `s` partially 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
11 error[E0381]: partially assigned binding `t` isn't fully initialized
12   --> $DIR/issue-21232-partial-init-and-use.rs:103:5
13    |
14 LL |     let t: T;
15    |         - binding declared here but left uninitialized
16 LL |     t.0 = 10; t.1 = Box::new(20);
17    |     ^^^^^^^^ `t` partially 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
21 error[E0382]: assign to part of moved value: `s`
22   --> $DIR/issue-21232-partial-init-and-use.rs:109:5
23    |
24 LL |     let mut s: S<B> = S::new(); drop(s);
25    |         -----                        - value moved here
26    |         |
27    |         move occurs because `s` has type `S<Box<u32>>`, which does not implement the `Copy` trait
28 LL |     s.x = 10; s.y = Box::new(20);
29    |     ^^^^^^^^ value partially assigned here after move
30
31 error[E0382]: assign to part of moved value: `t`
32   --> $DIR/issue-21232-partial-init-and-use.rs:116:5
33    |
34 LL |     let mut t: T = (0, Box::new(0)); drop(t);
35    |         -----                             - value moved here
36    |         |
37    |         move occurs because `t` has type `(u32, Box<u32>)`, which does not implement the `Copy` trait
38 LL |     t.0 = 10; t.1 = Box::new(20);
39    |     ^^^^^^^^ value partially assigned here after move
40    |
41 help: consider cloning the value if the performance cost is acceptable
42    |
43 LL |     let mut t: T = (0, Box::new(0)); drop(t.clone());
44    |                                            ++++++++
45
46 error[E0381]: partially assigned binding `s` isn't fully initialized
47   --> $DIR/issue-21232-partial-init-and-use.rs:123:5
48    |
49 LL |     let s: S<B>;
50    |         - binding declared here but left uninitialized
51 LL |     s.x = 10;
52    |     ^^^^^^^^ `s` partially assigned here but it isn't fully initialized
53    |
54    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
55
56 error[E0381]: partially assigned binding `t` isn't fully initialized
57   --> $DIR/issue-21232-partial-init-and-use.rs:129:5
58    |
59 LL |     let t: T;
60    |         - binding declared here but left uninitialized
61 LL |     t.0 = 10;
62    |     ^^^^^^^^ `t` partially assigned here but it isn't fully initialized
63    |
64    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
65
66 error[E0382]: assign to part of moved value: `s`
67   --> $DIR/issue-21232-partial-init-and-use.rs:135:5
68    |
69 LL |     let mut s: S<B> = S::new(); drop(s);
70    |         -----                        - value moved here
71    |         |
72    |         move occurs because `s` has type `S<Box<u32>>`, which does not implement the `Copy` trait
73 LL |     s.x = 10;
74    |     ^^^^^^^^ value partially assigned here after move
75
76 error[E0382]: assign to part of moved value: `t`
77   --> $DIR/issue-21232-partial-init-and-use.rs:142:5
78    |
79 LL |     let mut t: T = (0, Box::new(0)); drop(t);
80    |         -----                             - value moved here
81    |         |
82    |         move occurs because `t` has type `(u32, Box<u32>)`, which does not implement the `Copy` trait
83 LL |     t.0 = 10;
84    |     ^^^^^^^^ value partially assigned here after move
85    |
86 help: consider cloning the value if the performance cost is acceptable
87    |
88 LL |     let mut t: T = (0, Box::new(0)); drop(t.clone());
89    |                                            ++++++++
90
91 error[E0381]: partially assigned binding `s` isn't fully initialized
92   --> $DIR/issue-21232-partial-init-and-use.rs:149:5
93    |
94 LL |     let s: S<Void>;
95    |         - binding declared here but left uninitialized
96 LL |     s.x = 10;
97    |     ^^^^^^^^ `s` partially assigned here but it isn't fully initialized
98    |
99    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
100
101 error[E0381]: partially assigned binding `t` isn't fully initialized
102   --> $DIR/issue-21232-partial-init-and-use.rs:155:5
103    |
104 LL |     let t: Tvoid;
105    |         - binding declared here but left uninitialized
106 LL |     t.0 = 10;
107    |     ^^^^^^^^ `t` partially assigned here but it isn't fully initialized
108    |
109    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
110
111 error[E0381]: partially assigned binding `q` isn't fully initialized
112   --> $DIR/issue-21232-partial-init-and-use.rs:170:5
113    |
114 LL |     let q: Q<S<B>>;
115    |         - binding declared here but left uninitialized
116 LL |     q.r.f.x = 10; q.r.f.y = Box::new(20);
117    |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
118    |
119    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
120
121 error[E0381]: partially assigned binding `q` isn't fully initialized
122   --> $DIR/issue-21232-partial-init-and-use.rs:176:5
123    |
124 LL |     let q: Q<T>;
125    |         - binding declared here but left uninitialized
126 LL |     q.r.f.0 = 10; q.r.f.1 = Box::new(20);
127    |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
128    |
129    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
130
131 error[E0382]: assign to part of moved value: `q.r`
132   --> $DIR/issue-21232-partial-init-and-use.rs:182:5
133    |
134 LL |     let mut q: Q<S<B>> = Q::new(S::new()); drop(q.r);
135    |                                                 --- value moved here
136 LL |     q.r.f.x = 10; q.r.f.y = Box::new(20);
137    |     ^^^^^^^^^^^^ value partially assigned here after move
138    |
139    = note: move occurs because `q.r` has type `R<S<Box<u32>>>`, which does not implement the `Copy` trait
140
141 error[E0382]: assign to part of moved value: `q.r`
142   --> $DIR/issue-21232-partial-init-and-use.rs:189:5
143    |
144 LL |     let mut q: Q<T> = Q::new((0, Box::new(0))); drop(q.r);
145    |                                                      --- value moved here
146 LL |     q.r.f.0 = 10; q.r.f.1 = Box::new(20);
147    |     ^^^^^^^^^^^^ value partially assigned here after move
148    |
149    = note: move occurs because `q.r` has type `R<(u32, Box<u32>)>`, which does not implement the `Copy` trait
150
151 error[E0381]: partially assigned binding `q` isn't fully initialized
152   --> $DIR/issue-21232-partial-init-and-use.rs:196:5
153    |
154 LL |     let q: Q<S<B>>;
155    |         - binding declared here but left uninitialized
156 LL |     q.r.f.x = 10;
157    |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
158    |
159    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
160
161 error[E0381]: partially assigned binding `q` isn't fully initialized
162   --> $DIR/issue-21232-partial-init-and-use.rs:202:5
163    |
164 LL |     let q: Q<T>;
165    |         - binding declared here but left uninitialized
166 LL |     q.r.f.0 = 10;
167    |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
168    |
169    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
170
171 error[E0382]: assign to part of moved value: `q.r`
172   --> $DIR/issue-21232-partial-init-and-use.rs:208:5
173    |
174 LL |     let mut q: Q<S<B>> = Q::new(S::new()); drop(q.r);
175    |                                                 --- value moved here
176 LL |     q.r.f.x = 10;
177    |     ^^^^^^^^^^^^ value partially assigned here after move
178    |
179    = note: move occurs because `q.r` has type `R<S<Box<u32>>>`, which does not implement the `Copy` trait
180
181 error[E0382]: assign to part of moved value: `q.r`
182   --> $DIR/issue-21232-partial-init-and-use.rs:215:5
183    |
184 LL |     let mut q: Q<T> = Q::new((0, Box::new(0))); drop(q.r);
185    |                                                      --- value moved here
186 LL |     q.r.f.0 = 10;
187    |     ^^^^^^^^^^^^ value partially assigned here after move
188    |
189    = note: move occurs because `q.r` has type `R<(u32, Box<u32>)>`, which does not implement the `Copy` trait
190
191 error[E0381]: partially assigned binding `q` isn't fully initialized
192   --> $DIR/issue-21232-partial-init-and-use.rs:222:5
193    |
194 LL |     let mut q: Q<S<Void>>;
195    |         ----- binding declared here but left uninitialized
196 LL |     q.r.f.x = 10;
197    |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
198    |
199    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
200
201 error[E0381]: partially assigned binding `q` isn't fully initialized
202   --> $DIR/issue-21232-partial-init-and-use.rs:228:5
203    |
204 LL |     let mut q: Q<Tvoid>;
205    |         ----- binding declared here but left uninitialized
206 LL |     q.r.f.0 = 10;
207    |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
208    |
209    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
210
211 error[E0382]: assign to part of moved value: `c`
212   --> $DIR/issue-21232-partial-init-and-use.rs:245:13
213    |
214 LL |     let mut c = (1, "".to_owned());
215    |         ----- move occurs because `c` has type `(i32, String)`, which does not implement the `Copy` trait
216 LL |     match c {
217 LL |         c2 => {
218    |         -- value moved here
219 LL |             c.0 = 2;
220    |             ^^^^^^^ value partially assigned here after move
221    |
222 help: borrow this binding in the pattern to avoid moving the value
223    |
224 LL |         ref c2 => {
225    |         +++
226
227 error[E0382]: assign to part of moved value: `c`
228   --> $DIR/issue-21232-partial-init-and-use.rs:255:13
229    |
230 LL |     let mut c = (1, (1, "".to_owned()));
231    |         ----- move occurs because `c` has type `(i32, (i32, String))`, which does not implement the `Copy` trait
232 LL |     match c {
233 LL |         c2 => {
234    |         -- value moved here
235 LL |             (c.1).0 = 2;
236    |             ^^^^^^^^^^^ value partially assigned here after move
237    |
238 help: borrow this binding in the pattern to avoid moving the value
239    |
240 LL |         ref c2 => {
241    |         +++
242
243 error[E0382]: assign to part of moved value: `c.1`
244   --> $DIR/issue-21232-partial-init-and-use.rs:263:13
245    |
246 LL |         c2 => {
247    |         -- value moved here
248 LL |             ((c.1).1).0 = 3;
249    |             ^^^^^^^^^^^^^^^ value partially assigned here after move
250    |
251    = note: move occurs because `c.1` has type `(i32, (i32, String))`, which does not implement the `Copy` trait
252 help: borrow this binding in the pattern to avoid moving the value
253    |
254 LL |         ref c2 => {
255    |         +++
256
257 error: aborting due to 23 previous errors
258
259 Some errors have detailed explanations: E0381, E0382.
260 For more information about an error, try `rustc --explain E0381`.