diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:24 +0000 |
commit | 023939b627b7dc93b01471f7d41fb8553ddb4ffa (patch) | |
tree | 60fc59477c605c72b0a1051409062ddecc43f877 /tests/ui/layout | |
parent | Adding debian version 1.72.1+dfsg1-1. (diff) | |
download | rustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.tar.xz rustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.zip |
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/layout')
-rw-r--r-- | tests/ui/layout/debug.stderr | 36 | ||||
-rw-r--r-- | tests/ui/layout/hexagon-enum.stderr | 20 | ||||
-rw-r--r-- | tests/ui/layout/issue-113941.rs | 13 | ||||
-rw-r--r-- | tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr | 34 | ||||
-rw-r--r-- | tests/ui/layout/issue-96185-overaligned-enum.stderr | 24 | ||||
-rw-r--r-- | tests/ui/layout/malformed-unsized-type-in-union.rs | 8 | ||||
-rw-r--r-- | tests/ui/layout/malformed-unsized-type-in-union.stderr | 9 | ||||
-rw-r--r-- | tests/ui/layout/thumb-enum.stderr | 20 | ||||
-rw-r--r-- | tests/ui/layout/valid_range_oob.stderr | 1 | ||||
-rw-r--r-- | tests/ui/layout/zero-sized-array-enum-niche.stderr | 26 |
10 files changed, 191 insertions, 0 deletions
diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index b9fa1b299..eeffb3c5f 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -53,6 +53,8 @@ error: layout_of(E) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(12 bytes), @@ -77,9 +79,13 @@ error: layout_of(E) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/debug.rs:7:1 | @@ -124,6 +130,8 @@ error: layout_of(S) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/debug.rs:10:1 | @@ -146,6 +154,8 @@ error: layout_of(U) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/debug.rs:13:1 | @@ -237,6 +247,8 @@ error: layout_of(std::result::Result<i32, i32>) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, Layout { size: Size(8 bytes), @@ -272,9 +284,13 @@ error: layout_of(std::result::Result<i32, i32>) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/debug.rs:16:1 | @@ -301,6 +317,8 @@ error: layout_of(i32) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/debug.rs:19:1 | @@ -323,6 +341,8 @@ error: layout_of(V) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), } --> $DIR/debug.rs:22:1 | @@ -345,6 +365,8 @@ error: layout_of(W) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), } --> $DIR/debug.rs:28:1 | @@ -367,6 +389,8 @@ error: layout_of(Y) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), } --> $DIR/debug.rs:34:1 | @@ -389,6 +413,8 @@ error: layout_of(P1) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/debug.rs:41:1 | @@ -411,6 +437,8 @@ error: layout_of(P2) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/debug.rs:45:1 | @@ -433,6 +461,8 @@ error: layout_of(P3) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/debug.rs:53:1 | @@ -455,6 +485,8 @@ error: layout_of(P4) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/debug.rs:57:1 | @@ -482,6 +514,8 @@ error: layout_of(P5) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/debug.rs:61:1 | @@ -509,6 +543,8 @@ error: layout_of(std::mem::MaybeUninit<u8>) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/debug.rs:64:1 | diff --git a/tests/ui/layout/hexagon-enum.stderr b/tests/ui/layout/hexagon-enum.stderr index d850dd69c..a2ad4a1ab 100644 --- a/tests/ui/layout/hexagon-enum.stderr +++ b/tests/ui/layout/hexagon-enum.stderr @@ -59,9 +59,13 @@ error: layout_of(A) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/hexagon-enum.rs:16:1 | @@ -129,9 +133,13 @@ error: layout_of(B) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/hexagon-enum.rs:20:1 | @@ -199,9 +207,13 @@ error: layout_of(C) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), } --> $DIR/hexagon-enum.rs:24:1 | @@ -269,9 +281,13 @@ error: layout_of(P) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/hexagon-enum.rs:28:1 | @@ -339,9 +355,13 @@ error: layout_of(T) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/hexagon-enum.rs:34:1 | diff --git a/tests/ui/layout/issue-113941.rs b/tests/ui/layout/issue-113941.rs new file mode 100644 index 000000000..7a54e28b3 --- /dev/null +++ b/tests/ui/layout/issue-113941.rs @@ -0,0 +1,13 @@ +// build-pass +// revisions: normal randomize-layout +// [randomize-layout]compile-flags: -Zrandomize-layout + +enum Void {} + +pub struct Struct([*const (); 0], Void); + +pub enum Enum { + Variant(Struct), +} + +fn main() {} diff --git a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr index 8c7c91535..d3ba1a295 100644 --- a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr +++ b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr @@ -81,6 +81,8 @@ error: layout_of(MissingPayloadField) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(1 bytes), @@ -99,9 +101,13 @@ error: layout_of(MissingPayloadField) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:16:1 | @@ -193,6 +199,8 @@ error: layout_of(CommonPayloadField) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(2 bytes), @@ -228,9 +236,13 @@ error: layout_of(CommonPayloadField) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:25:1 | @@ -320,6 +332,8 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(2 bytes), @@ -354,9 +368,13 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:33:1 | @@ -462,6 +480,8 @@ error: layout_of(NicheFirst) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(0 bytes), @@ -480,6 +500,8 @@ error: layout_of(NicheFirst) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(0 bytes), @@ -498,9 +520,13 @@ error: layout_of(NicheFirst) = Layout { variants: Single { index: 2, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:41:1 | @@ -606,6 +632,8 @@ error: layout_of(NicheSecond) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(0 bytes), @@ -624,6 +652,8 @@ error: layout_of(NicheSecond) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(0 bytes), @@ -642,9 +672,13 @@ error: layout_of(NicheSecond) = Layout { variants: Single { index: 2, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:50:1 | diff --git a/tests/ui/layout/issue-96185-overaligned-enum.stderr b/tests/ui/layout/issue-96185-overaligned-enum.stderr index de6177c8d..c539eb453 100644 --- a/tests/ui/layout/issue-96185-overaligned-enum.stderr +++ b/tests/ui/layout/issue-96185-overaligned-enum.stderr @@ -53,6 +53,10 @@ error: layout_of(Aligned1) = Layout { variants: Single { index: 0, }, + max_repr_align: Some( + Align(8 bytes), + ), + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(8 bytes), @@ -71,9 +75,17 @@ error: layout_of(Aligned1) = Layout { variants: Single { index: 1, }, + max_repr_align: Some( + Align(8 bytes), + ), + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: Some( + Align(8 bytes), + ), + unadjusted_abi_align: Align(1 bytes), } --> $DIR/issue-96185-overaligned-enum.rs:8:1 | @@ -141,6 +153,10 @@ error: layout_of(Aligned2) = Layout { variants: Single { index: 0, }, + max_repr_align: Some( + Align(1 bytes), + ), + unadjusted_abi_align: Align(1 bytes), }, Layout { size: Size(1 bytes), @@ -159,9 +175,17 @@ error: layout_of(Aligned2) = Layout { variants: Single { index: 1, }, + max_repr_align: Some( + Align(1 bytes), + ), + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: Some( + Align(1 bytes), + ), + unadjusted_abi_align: Align(1 bytes), } --> $DIR/issue-96185-overaligned-enum.rs:16:1 | diff --git a/tests/ui/layout/malformed-unsized-type-in-union.rs b/tests/ui/layout/malformed-unsized-type-in-union.rs new file mode 100644 index 000000000..5d8ec576c --- /dev/null +++ b/tests/ui/layout/malformed-unsized-type-in-union.rs @@ -0,0 +1,8 @@ +// issue: 113760 + +union W { s: dyn Iterator<Item = Missing> } +//~^ ERROR cannot find type `Missing` in this scope + +static ONCE: W = todo!(); + +fn main() {} diff --git a/tests/ui/layout/malformed-unsized-type-in-union.stderr b/tests/ui/layout/malformed-unsized-type-in-union.stderr new file mode 100644 index 000000000..cbb8d6af3 --- /dev/null +++ b/tests/ui/layout/malformed-unsized-type-in-union.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `Missing` in this scope + --> $DIR/malformed-unsized-type-in-union.rs:3:34 + | +LL | union W { s: dyn Iterator<Item = Missing> } + | ^^^^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0412`. diff --git a/tests/ui/layout/thumb-enum.stderr b/tests/ui/layout/thumb-enum.stderr index 227bd950b..6f6ab4982 100644 --- a/tests/ui/layout/thumb-enum.stderr +++ b/tests/ui/layout/thumb-enum.stderr @@ -59,9 +59,13 @@ error: layout_of(A) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/thumb-enum.rs:16:1 | @@ -129,9 +133,13 @@ error: layout_of(B) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), } --> $DIR/thumb-enum.rs:20:1 | @@ -199,9 +207,13 @@ error: layout_of(C) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), } --> $DIR/thumb-enum.rs:24:1 | @@ -269,9 +281,13 @@ error: layout_of(P) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/thumb-enum.rs:28:1 | @@ -339,9 +355,13 @@ error: layout_of(T) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/thumb-enum.rs:34:1 | diff --git a/tests/ui/layout/valid_range_oob.stderr b/tests/ui/layout/valid_range_oob.stderr index a3a514fb8..d56804a35 100644 --- a/tests/ui/layout/valid_range_oob.stderr +++ b/tests/ui/layout/valid_range_oob.stderr @@ -1,3 +1,4 @@ +257 > 255 error: the compiler unexpectedly panicked. this is a bug. query stack during panic: diff --git a/tests/ui/layout/zero-sized-array-enum-niche.stderr b/tests/ui/layout/zero-sized-array-enum-niche.stderr index a3e82070e..df9f1cc8d 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.stderr +++ b/tests/ui/layout/zero-sized-array-enum-niche.stderr @@ -57,6 +57,8 @@ error: layout_of(std::result::Result<[u32; 0], bool>) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, Layout { size: Size(2 bytes), @@ -88,9 +90,13 @@ error: layout_of(std::result::Result<[u32; 0], bool>) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/zero-sized-array-enum-niche.rs:13:1 | @@ -156,6 +162,8 @@ error: layout_of(MultipleAlignments) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(2 bytes), }, Layout { size: Size(4 bytes), @@ -178,6 +186,8 @@ error: layout_of(MultipleAlignments) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, Layout { size: Size(2 bytes), @@ -209,9 +219,13 @@ error: layout_of(MultipleAlignments) = Layout { variants: Single { index: 2, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/zero-sized-array-enum-niche.rs:21:1 | @@ -277,6 +291,8 @@ error: layout_of(std::result::Result<[u32; 0], Packed<std::num::NonZeroU16>>) = variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, Layout { size: Size(3 bytes), @@ -308,9 +324,13 @@ error: layout_of(std::result::Result<[u32; 0], Packed<std::num::NonZeroU16>>) = variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/zero-sized-array-enum-niche.rs:37:1 | @@ -380,6 +400,8 @@ error: layout_of(std::result::Result<[u32; 0], Packed<U16IsZero>>) = Layout { variants: Single { index: 0, }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), }, Layout { size: Size(2 bytes), @@ -411,9 +433,13 @@ error: layout_of(std::result::Result<[u32; 0], Packed<U16IsZero>>) = Layout { variants: Single { index: 1, }, + max_repr_align: None, + unadjusted_abi_align: Align(1 bytes), }, ], }, + max_repr_align: None, + unadjusted_abi_align: Align(4 bytes), } --> $DIR/zero-sized-array-enum-niche.rs:44:1 | |