diff options
Diffstat (limited to 'tests/ui/layout')
| -rw-r--r-- | tests/ui/layout/debug.rs | 1 | ||||
| -rw-r--r-- | tests/ui/layout/debug.stderr | 30 |
2 files changed, 16 insertions, 15 deletions
diff --git a/tests/ui/layout/debug.rs b/tests/ui/layout/debug.rs index b87a1d2031d..90e3c58dad7 100644 --- a/tests/ui/layout/debug.rs +++ b/tests/ui/layout/debug.rs @@ -18,6 +18,7 @@ type Test = Result<i32, i32>; //~ ERROR: layout_of #[rustc_layout(debug)] type T = impl std::fmt::Debug; //~ ERROR: layout_of +#[define_opaque(T)] fn f() -> T { 0i32 } diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index 80b35ff6ad4..abaa16cdefa 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -1,5 +1,5 @@ error: unions cannot have zero fields - --> $DIR/debug.rs:83:1 + --> $DIR/debug.rs:84:1 | LL | union EmptyUnion {} | ^^^^^^^^^^^^^^^^^^^ @@ -372,7 +372,7 @@ error: layout_of(V) = Layout { unadjusted_abi_align: Align(2 bytes), randomization_seed: $SEED, } - --> $DIR/debug.rs:26:1 + --> $DIR/debug.rs:27:1 | LL | pub union V { | ^^^^^^^^^^^ @@ -398,7 +398,7 @@ error: layout_of(W) = Layout { unadjusted_abi_align: Align(2 bytes), randomization_seed: $SEED, } - --> $DIR/debug.rs:32:1 + --> $DIR/debug.rs:33:1 | LL | pub union W { | ^^^^^^^^^^^ @@ -424,7 +424,7 @@ error: layout_of(Y) = Layout { unadjusted_abi_align: Align(2 bytes), randomization_seed: $SEED, } - --> $DIR/debug.rs:38:1 + --> $DIR/debug.rs:39:1 | LL | pub union Y { | ^^^^^^^^^^^ @@ -450,7 +450,7 @@ error: layout_of(P1) = Layout { unadjusted_abi_align: Align(1 bytes), randomization_seed: $SEED, } - --> $DIR/debug.rs:45:1 + --> $DIR/debug.rs:46:1 | LL | union P1 { x: u32 } | ^^^^^^^^ @@ -476,7 +476,7 @@ error: layout_of(P2) = Layout { unadjusted_abi_align: Align(1 bytes), randomization_seed: $SEED, } - --> $DIR/debug.rs:49:1 + --> $DIR/debug.rs:50:1 | LL | union P2 { x: (u32, u32) } | ^^^^^^^^ @@ -502,7 +502,7 @@ error: layout_of(P3) = Layout { unadjusted_abi_align: Align(1 bytes), randomization_seed: $SEED, } - --> $DIR/debug.rs:57:1 + --> $DIR/debug.rs:58:1 | LL | union P3 { x: F32x4 } | ^^^^^^^^ @@ -528,7 +528,7 @@ error: layout_of(P4) = Layout { unadjusted_abi_align: Align(1 bytes), randomization_seed: $SEED, } - --> $DIR/debug.rs:61:1 + --> $DIR/debug.rs:62:1 | LL | union P4 { x: E } | ^^^^^^^^ @@ -559,7 +559,7 @@ error: layout_of(P5) = Layout { unadjusted_abi_align: Align(1 bytes), randomization_seed: $SEED, } - --> $DIR/debug.rs:65:1 + --> $DIR/debug.rs:66:1 | LL | union P5 { zst: [u16; 0], byte: u8 } | ^^^^^^^^ @@ -590,19 +590,19 @@ error: layout_of(MaybeUninit<u8>) = Layout { unadjusted_abi_align: Align(1 bytes), randomization_seed: $SEED, } - --> $DIR/debug.rs:68:1 + --> $DIR/debug.rs:69:1 | LL | type X = std::mem::MaybeUninit<u8>; | ^^^^^^ error: `#[rustc_layout]` can only be applied to `struct`/`enum`/`union` declarations and type aliases - --> $DIR/debug.rs:71:1 + --> $DIR/debug.rs:72:1 | LL | const C: () = (); | ^^^^^^^^^^^ error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/debug.rs:79:19 + --> $DIR/debug.rs:80:19 | LL | type Impossible = (str, str); | ^^^^^^^^^^ doesn't have a size known at compile-time @@ -611,19 +611,19 @@ LL | type Impossible = (str, str); = note: only the last element of a tuple may have a dynamically sized type error: the type has an unknown layout - --> $DIR/debug.rs:83:1 + --> $DIR/debug.rs:84:1 | LL | union EmptyUnion {} | ^^^^^^^^^^^^^^^^ error: the type `T` does not have a fixed layout - --> $DIR/debug.rs:89:1 + --> $DIR/debug.rs:90:1 | LL | type TooGeneric<T> = T; | ^^^^^^^^^^^^^^^^^^ error: `#[rustc_layout]` can only be applied to `struct`/`enum`/`union` declarations and type aliases - --> $DIR/debug.rs:75:5 + --> $DIR/debug.rs:76:5 | LL | const C: () = (); | ^^^^^^^^^^^ |
