fork/rust

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

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

master
16.0 KiB577 linesraw
1error: layout_of(E) = Layout {
2           size: Size(12 bytes),
3           align: AbiAndPrefAlign {
4               abi: Align(4 bytes),
5               pref: $SOME_ALIGN,
6           },
7           abi: Aggregate {
8               sized: true,
9           },
10           fields: Arbitrary {
11               offsets: [
12                   Size(0 bytes),
13               ],
14               memory_index: [
15                   0,
16               ],
17           },
18           largest_niche: Some(
19               Niche {
20                   offset: Size(0 bytes),
21                   value: Int(
22                       I32,
23                       false,
24                   ),
25                   valid_range: 0..=0,
26               },
27           ),
28           variants: Multiple {
29               tag: Initialized {
30                   value: Int(
31                       I32,
32                       false,
33                   ),
34                   valid_range: 0..=0,
35               },
36               tag_encoding: Direct,
37               tag_field: 0,
38               variants: [
39                   Layout {
40                       size: Size(4 bytes),
41                       align: AbiAndPrefAlign {
42                           abi: Align(1 bytes),
43                           pref: $SOME_ALIGN,
44                       },
45                       abi: Aggregate {
46                           sized: true,
47                       },
48                       fields: Arbitrary {
49                           offsets: [],
50                           memory_index: [],
51                       },
52                       largest_niche: None,
53                       variants: Single {
54                           index: 0,
55                       },
56                       max_repr_align: None,
57                       unadjusted_abi_align: Align(1 bytes),
58                   },
59                   Layout {
60                       size: Size(12 bytes),
61                       align: AbiAndPrefAlign {
62                           abi: Align(4 bytes),
63                           pref: $SOME_ALIGN,
64                       },
65                       abi: Uninhabited,
66                       fields: Arbitrary {
67                           offsets: [
68                               Size(4 bytes),
69                               Size(4 bytes),
70                               Size(8 bytes),
71                           ],
72                           memory_index: [
73                               0,
74                               1,
75                               2,
76                           ],
77                       },
78                       largest_niche: None,
79                       variants: Single {
80                           index: 1,
81                       },
82                       max_repr_align: None,
83                       unadjusted_abi_align: Align(4 bytes),
84                   },
85               ],
86           },
87           max_repr_align: None,
88           unadjusted_abi_align: Align(4 bytes),
89       }
90  --> $DIR/debug.rs:7:1
91   |
92LL | enum E { Foo, Bar(!, i32, i32) }
93   | ^^^^^^
94
95error: layout_of(S) = Layout {
96           size: Size(8 bytes),
97           align: AbiAndPrefAlign {
98               abi: Align(4 bytes),
99               pref: $SOME_ALIGN,
100           },
101           abi: ScalarPair(
102               Initialized {
103                   value: Int(
104                       I32,
105                       true,
106                   ),
107                   valid_range: 0..=4294967295,
108               },
109               Initialized {
110                   value: Int(
111                       I32,
112                       true,
113                   ),
114                   valid_range: 0..=4294967295,
115               },
116           ),
117           fields: Arbitrary {
118               offsets: [
119                   Size(0 bytes),
120                   Size(8 bytes),
121                   Size(4 bytes),
122               ],
123               memory_index: [
124                   0,
125                   2,
126                   1,
127               ],
128           },
129           largest_niche: None,
130           variants: Single {
131               index: 0,
132           },
133           max_repr_align: None,
134           unadjusted_abi_align: Align(4 bytes),
135       }
136  --> $DIR/debug.rs:10:1
137   |
138LL | struct S { f1: i32, f2: (), f3: i32 }
139   | ^^^^^^^^
140
141error: layout_of(U) = Layout {
142           size: Size(8 bytes),
143           align: AbiAndPrefAlign {
144               abi: Align(4 bytes),
145               pref: $SOME_ALIGN,
146           },
147           abi: Aggregate {
148               sized: true,
149           },
150           fields: Union(
151               2,
152           ),
153           largest_niche: None,
154           variants: Single {
155               index: 0,
156           },
157           max_repr_align: None,
158           unadjusted_abi_align: Align(4 bytes),
159       }
160  --> $DIR/debug.rs:13:1
161   |
162LL | union U { f1: (i32, i32), f3: i32 }
163   | ^^^^^^^
164
165error: layout_of(Result<i32, i32>) = Layout {
166           size: Size(8 bytes),
167           align: AbiAndPrefAlign {
168               abi: Align(4 bytes),
169               pref: $SOME_ALIGN,
170           },
171           abi: ScalarPair(
172               Initialized {
173                   value: Int(
174                       I32,
175                       false,
176                   ),
177                   valid_range: 0..=1,
178               },
179               Initialized {
180                   value: Int(
181                       I32,
182                       true,
183                   ),
184                   valid_range: 0..=4294967295,
185               },
186           ),
187           fields: Arbitrary {
188               offsets: [
189                   Size(0 bytes),
190               ],
191               memory_index: [
192                   0,
193               ],
194           },
195           largest_niche: Some(
196               Niche {
197                   offset: Size(0 bytes),
198                   value: Int(
199                       I32,
200                       false,
201                   ),
202                   valid_range: 0..=1,
203               },
204           ),
205           variants: Multiple {
206               tag: Initialized {
207                   value: Int(
208                       I32,
209                       false,
210                   ),
211                   valid_range: 0..=1,
212               },
213               tag_encoding: Direct,
214               tag_field: 0,
215               variants: [
216                   Layout {
217                       size: Size(8 bytes),
218                       align: AbiAndPrefAlign {
219                           abi: Align(4 bytes),
220                           pref: $SOME_ALIGN,
221                       },
222                       abi: ScalarPair(
223                           Initialized {
224                               value: Int(
225                                   I32,
226                                   false,
227                               ),
228                               valid_range: 0..=1,
229                           },
230                           Initialized {
231                               value: Int(
232                                   I32,
233                                   true,
234                               ),
235                               valid_range: 0..=4294967295,
236                           },
237                       ),
238                       fields: Arbitrary {
239                           offsets: [
240                               Size(4 bytes),
241                           ],
242                           memory_index: [
243                               0,
244                           ],
245                       },
246                       largest_niche: None,
247                       variants: Single {
248                           index: 0,
249                       },
250                       max_repr_align: None,
251                       unadjusted_abi_align: Align(4 bytes),
252                   },
253                   Layout {
254                       size: Size(8 bytes),
255                       align: AbiAndPrefAlign {
256                           abi: Align(4 bytes),
257                           pref: $SOME_ALIGN,
258                       },
259                       abi: ScalarPair(
260                           Initialized {
261                               value: Int(
262                                   I32,
263                                   false,
264                               ),
265                               valid_range: 0..=1,
266                           },
267                           Initialized {
268                               value: Int(
269                                   I32,
270                                   true,
271                               ),
272                               valid_range: 0..=4294967295,
273                           },
274                       ),
275                       fields: Arbitrary {
276                           offsets: [
277                               Size(4 bytes),
278                           ],
279                           memory_index: [
280                               0,
281                           ],
282                       },
283                       largest_niche: None,
284                       variants: Single {
285                           index: 1,
286                       },
287                       max_repr_align: None,
288                       unadjusted_abi_align: Align(4 bytes),
289                   },
290               ],
291           },
292           max_repr_align: None,
293           unadjusted_abi_align: Align(4 bytes),
294       }
295  --> $DIR/debug.rs:16:1
296   |
297LL | type Test = Result<i32, i32>;
298   | ^^^^^^^^^
299
300error: layout_of(i32) = Layout {
301           size: Size(4 bytes),
302           align: AbiAndPrefAlign {
303               abi: Align(4 bytes),
304               pref: $SOME_ALIGN,
305           },
306           abi: Scalar(
307               Initialized {
308                   value: Int(
309                       I32,
310                       true,
311                   ),
312                   valid_range: 0..=4294967295,
313               },
314           ),
315           fields: Primitive,
316           largest_niche: None,
317           variants: Single {
318               index: 0,
319           },
320           max_repr_align: None,
321           unadjusted_abi_align: Align(4 bytes),
322       }
323  --> $DIR/debug.rs:19:1
324   |
325LL | type T = impl std::fmt::Debug;
326   | ^^^^^^
327
328error: layout_of(V) = Layout {
329           size: Size(2 bytes),
330           align: AbiAndPrefAlign {
331               abi: Align(2 bytes),
332               pref: $SOME_ALIGN,
333           },
334           abi: Aggregate {
335               sized: true,
336           },
337           fields: Union(
338               2,
339           ),
340           largest_niche: None,
341           variants: Single {
342               index: 0,
343           },
344           max_repr_align: None,
345           unadjusted_abi_align: Align(2 bytes),
346       }
347  --> $DIR/debug.rs:25:1
348   |
349LL | pub union V {
350   | ^^^^^^^^^^^
351
352error: layout_of(W) = Layout {
353           size: Size(2 bytes),
354           align: AbiAndPrefAlign {
355               abi: Align(2 bytes),
356               pref: $SOME_ALIGN,
357           },
358           abi: Aggregate {
359               sized: true,
360           },
361           fields: Union(
362               2,
363           ),
364           largest_niche: None,
365           variants: Single {
366               index: 0,
367           },
368           max_repr_align: None,
369           unadjusted_abi_align: Align(2 bytes),
370       }
371  --> $DIR/debug.rs:31:1
372   |
373LL | pub union W {
374   | ^^^^^^^^^^^
375
376error: layout_of(Y) = Layout {
377           size: Size(0 bytes),
378           align: AbiAndPrefAlign {
379               abi: Align(2 bytes),
380               pref: $SOME_ALIGN,
381           },
382           abi: Aggregate {
383               sized: true,
384           },
385           fields: Union(
386               2,
387           ),
388           largest_niche: None,
389           variants: Single {
390               index: 0,
391           },
392           max_repr_align: None,
393           unadjusted_abi_align: Align(2 bytes),
394       }
395  --> $DIR/debug.rs:37:1
396   |
397LL | pub union Y {
398   | ^^^^^^^^^^^
399
400error: layout_of(P1) = Layout {
401           size: Size(4 bytes),
402           align: AbiAndPrefAlign {
403               abi: Align(1 bytes),
404               pref: $SOME_ALIGN,
405           },
406           abi: Aggregate {
407               sized: true,
408           },
409           fields: Union(
410               1,
411           ),
412           largest_niche: None,
413           variants: Single {
414               index: 0,
415           },
416           max_repr_align: None,
417           unadjusted_abi_align: Align(1 bytes),
418       }
419  --> $DIR/debug.rs:44:1
420   |
421LL | union P1 { x: u32 }
422   | ^^^^^^^^
423
424error: layout_of(P2) = Layout {
425           size: Size(8 bytes),
426           align: AbiAndPrefAlign {
427               abi: Align(1 bytes),
428               pref: $SOME_ALIGN,
429           },
430           abi: Aggregate {
431               sized: true,
432           },
433           fields: Union(
434               1,
435           ),
436           largest_niche: None,
437           variants: Single {
438               index: 0,
439           },
440           max_repr_align: None,
441           unadjusted_abi_align: Align(1 bytes),
442       }
443  --> $DIR/debug.rs:48:1
444   |
445LL | union P2 { x: (u32, u32) }
446   | ^^^^^^^^
447
448error: layout_of(P3) = Layout {
449           size: Size(16 bytes),
450           align: AbiAndPrefAlign {
451               abi: Align(1 bytes),
452               pref: $SOME_ALIGN,
453           },
454           abi: Aggregate {
455               sized: true,
456           },
457           fields: Union(
458               1,
459           ),
460           largest_niche: None,
461           variants: Single {
462               index: 0,
463           },
464           max_repr_align: None,
465           unadjusted_abi_align: Align(1 bytes),
466       }
467  --> $DIR/debug.rs:56:1
468   |
469LL | union P3 { x: F32x4 }
470   | ^^^^^^^^
471
472error: layout_of(P4) = Layout {
473           size: Size(12 bytes),
474           align: AbiAndPrefAlign {
475               abi: Align(1 bytes),
476               pref: $SOME_ALIGN,
477           },
478           abi: Aggregate {
479               sized: true,
480           },
481           fields: Union(
482               1,
483           ),
484           largest_niche: None,
485           variants: Single {
486               index: 0,
487           },
488           max_repr_align: None,
489           unadjusted_abi_align: Align(1 bytes),
490       }
491  --> $DIR/debug.rs:60:1
492   |
493LL | union P4 { x: E }
494   | ^^^^^^^^
495
496error: layout_of(P5) = Layout {
497           size: Size(1 bytes),
498           align: AbiAndPrefAlign {
499               abi: Align(1 bytes),
500               pref: $SOME_ALIGN,
501           },
502           abi: Scalar(
503               Union {
504                   value: Int(
505                       I8,
506                       false,
507                   ),
508               },
509           ),
510           fields: Union(
511               2,
512           ),
513           largest_niche: None,
514           variants: Single {
515               index: 0,
516           },
517           max_repr_align: None,
518           unadjusted_abi_align: Align(1 bytes),
519       }
520  --> $DIR/debug.rs:64:1
521   |
522LL | union P5 { zst: [u16; 0], byte: u8 }
523   | ^^^^^^^^
524
525error: layout_of(MaybeUninit<u8>) = Layout {
526           size: Size(1 bytes),
527           align: AbiAndPrefAlign {
528               abi: Align(1 bytes),
529               pref: $SOME_ALIGN,
530           },
531           abi: Scalar(
532               Union {
533                   value: Int(
534                       I8,
535                       false,
536                   ),
537               },
538           ),
539           fields: Union(
540               2,
541           ),
542           largest_niche: None,
543           variants: Single {
544               index: 0,
545           },
546           max_repr_align: None,
547           unadjusted_abi_align: Align(1 bytes),
548       }
549  --> $DIR/debug.rs:67:1
550   |
551LL | type X = std::mem::MaybeUninit<u8>;
552   | ^^^^^^
553
554error: `#[rustc_layout]` can only be applied to `struct`/`enum`/`union` declarations and type aliases
555  --> $DIR/debug.rs:70:1
556   |
557LL | const C: () = ();
558   | ^^^^^^^^^^^
559
560error[E0277]: the size for values of type `str` cannot be known at compilation time
561  --> $DIR/debug.rs:78:19
562   |
563LL | type Impossible = (str, str);
564   |                   ^^^^^^^^^^ doesn't have a size known at compile-time
565   |
566   = help: the trait `Sized` is not implemented for `str`
567   = note: only the last element of a tuple may have a dynamically sized type
568
569error: `#[rustc_layout]` can only be applied to `struct`/`enum`/`union` declarations and type aliases
570  --> $DIR/debug.rs:74:5
571   |
572LL |     const C: () = ();
573   |     ^^^^^^^^^^^
574
575error: aborting due to 17 previous errors
576
577For more information about this error, try `rustc --explain E0277`.