diff options
| author | Lukas Markeffsky <@> | 2024-09-15 22:16:21 +0200 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2024-09-16 15:53:21 +0200 |
| commit | 697450151c0b674eae406a4d1e0854e9386ac7ea (patch) | |
| tree | f5df62671bfc0e817080d1e4643cb880ec2d10f2 /tests/ui/layout/debug.stderr | |
| parent | 16be6666d4502e0e2255b9c4c1afab87db0ac50f (diff) | |
| download | rust-697450151c0b674eae406a4d1e0854e9386ac7ea.tar.gz rust-697450151c0b674eae406a4d1e0854e9386ac7ea.zip | |
layout computation: eagerly error for unexpected unsized fields
Diffstat (limited to 'tests/ui/layout/debug.stderr')
| -rw-r--r-- | tests/ui/layout/debug.stderr | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index 5162a771b4d..c9715a8e146 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -1,3 +1,9 @@ +error: unions cannot have zero fields + --> $DIR/debug.rs:82:1 + | +LL | union EmptyUnion {} + | ^^^^^^^^^^^^^^^^^^^ + error: layout_of(E) = Layout { size: Size(12 bytes), align: AbiAndPrefAlign { @@ -566,12 +572,18 @@ LL | type Impossible = (str, str); = help: the trait `Sized` is not implemented for `str` = note: only the last element of a tuple may have a dynamically sized type +error: the type `EmptyUnion` has an unknown layout + --> $DIR/debug.rs:82:1 + | +LL | union EmptyUnion {} + | ^^^^^^^^^^^^^^^^ + error: `#[rustc_layout]` can only be applied to `struct`/`enum`/`union` declarations and type aliases --> $DIR/debug.rs:74:5 | LL | const C: () = (); | ^^^^^^^^^^^ -error: aborting due to 17 previous errors +error: aborting due to 19 previous errors For more information about this error, try `rustc --explain E0277`. |
