diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-07-31 23:39:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-31 23:39:42 +0200 |
| commit | 549463f11427bcec19465e6f37f97d6dc686fb2e (patch) | |
| tree | 96af010d69449ddaf3fc8cc18f7815c70d7d4aab /src/test/ui/layout/debug.stderr | |
| parent | c98e893badd1204797e261a0ebf2341f01ff1a61 (diff) | |
| parent | abd80d904ba89f04f4ddb15a0a610d0dfbb44afe (diff) | |
Rollup merge of #99973 - RalfJung:layout-things, r=eddyb
Layout things These two commits are pretty independent, but didn't seem worth doing individual PRs for: - Always check that size is a multiple of align, even without debug assertions - Change Layout debug printing to put `variants` last, since it often huge and not usually the part we are most interested in Cc `@eddyb`
Diffstat (limited to 'src/test/ui/layout/debug.stderr')
| -rw-r--r-- | src/test/ui/layout/debug.stderr | 242 |
1 files changed, 121 insertions, 121 deletions
diff --git a/src/test/ui/layout/debug.stderr b/src/test/ui/layout/debug.stderr index 7ba9657fcd6..c5e1c41d130 100644 --- a/src/test/ui/layout/debug.stderr +++ b/src/test/ui/layout/debug.stderr @@ -1,4 +1,12 @@ error: layout_of(E) = Layout { + size: Size(12 bytes), + align: AbiAndPrefAlign { + abi: Align(4 bytes), + pref: $PREF_ALIGN, + }, + abi: Aggregate { + sized: true, + }, fields: Arbitrary { offsets: [ Size(0 bytes), @@ -7,6 +15,16 @@ error: layout_of(E) = Layout { 0, ], }, + largest_niche: Some( + Niche { + offset: Size(0 bytes), + value: Int( + I32, + false, + ), + valid_range: 0..=0, + }, + ), variants: Multiple { tag: Initialized { value: Int( @@ -19,24 +37,30 @@ error: layout_of(E) = Layout { tag_field: 0, variants: [ Layout { + size: Size(4 bytes), + align: AbiAndPrefAlign { + abi: Align(1 bytes), + pref: $PREF_ALIGN, + }, + abi: Aggregate { + sized: true, + }, fields: Arbitrary { offsets: [], memory_index: [], }, + largest_niche: None, variants: Single { index: 0, }, - abi: Aggregate { - sized: true, - }, - largest_niche: None, + }, + Layout { + size: Size(12 bytes), align: AbiAndPrefAlign { - abi: Align(1 bytes), + abi: Align(4 bytes), pref: $PREF_ALIGN, }, - size: Size(4 bytes), - }, - Layout { + abi: Uninhabited, fields: Arbitrary { offsets: [ Size(4 bytes), @@ -49,37 +73,13 @@ error: layout_of(E) = Layout { 2, ], }, + largest_niche: None, variants: Single { index: 1, }, - abi: Uninhabited, - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align(4 bytes), - pref: $PREF_ALIGN, - }, - size: Size(12 bytes), }, ], }, - abi: Aggregate { - sized: true, - }, - largest_niche: Some( - Niche { - offset: Size(0 bytes), - value: Int( - I32, - false, - ), - valid_range: 0..=0, - }, - ), - align: AbiAndPrefAlign { - abi: Align(4 bytes), - pref: $PREF_ALIGN, - }, - size: Size(12 bytes), } --> $DIR/debug.rs:6:1 | @@ -87,20 +87,10 @@ LL | enum E { Foo, Bar(!, i32, i32) } | ^^^^^^ error: layout_of(S) = Layout { - fields: Arbitrary { - offsets: [ - Size(0 bytes), - Size(0 bytes), - Size(4 bytes), - ], - memory_index: [ - 1, - 0, - 2, - ], - }, - variants: Single { - index: 0, + size: Size(8 bytes), + align: AbiAndPrefAlign { + abi: Align(4 bytes), + pref: $PREF_ALIGN, }, abi: ScalarPair( Initialized { @@ -118,12 +108,22 @@ error: layout_of(S) = Layout { valid_range: 0..=4294967295, }, ), + fields: Arbitrary { + offsets: [ + Size(0 bytes), + Size(0 bytes), + Size(4 bytes), + ], + memory_index: [ + 1, + 0, + 2, + ], + }, largest_niche: None, - align: AbiAndPrefAlign { - abi: Align(4 bytes), - pref: $PREF_ALIGN, + variants: Single { + index: 0, }, - size: Size(8 bytes), } --> $DIR/debug.rs:9:1 | @@ -131,21 +131,21 @@ LL | struct S { f1: i32, f2: (), f3: i32 } | ^^^^^^^^ error: layout_of(U) = Layout { - fields: Union( - 2, - ), - variants: Single { - index: 0, + size: Size(8 bytes), + align: AbiAndPrefAlign { + abi: Align(4 bytes), + pref: $PREF_ALIGN, }, abi: Aggregate { sized: true, }, + fields: Union( + 2, + ), largest_niche: None, - align: AbiAndPrefAlign { - abi: Align(4 bytes), - pref: $PREF_ALIGN, + variants: Single { + index: 0, }, - size: Size(8 bytes), } --> $DIR/debug.rs:12:1 | @@ -153,6 +153,27 @@ LL | union U { f1: (i32, i32), f3: i32 } | ^^^^^^^ error: layout_of(std::result::Result<i32, i32>) = Layout { + size: Size(8 bytes), + align: AbiAndPrefAlign { + abi: Align(4 bytes), + pref: $PREF_ALIGN, + }, + abi: ScalarPair( + Initialized { + value: Int( + I32, + false, + ), + valid_range: 0..=1, + }, + Initialized { + value: Int( + I32, + true, + ), + valid_range: 0..=4294967295, + }, + ), fields: Arbitrary { offsets: [ Size(0 bytes), @@ -161,6 +182,16 @@ error: layout_of(std::result::Result<i32, i32>) = Layout { 0, ], }, + largest_niche: Some( + Niche { + offset: Size(0 bytes), + value: Int( + I32, + false, + ), + valid_range: 0..=1, + }, + ), variants: Multiple { tag: Initialized { value: Int( @@ -173,16 +204,10 @@ error: layout_of(std::result::Result<i32, i32>) = Layout { tag_field: 0, variants: [ Layout { - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - memory_index: [ - 0, - ], - }, - variants: Single { - index: 0, + size: Size(8 bytes), + align: AbiAndPrefAlign { + abi: Align(4 bytes), + pref: $PREF_ALIGN, }, abi: ScalarPair( Initialized { @@ -200,14 +225,6 @@ error: layout_of(std::result::Result<i32, i32>) = Layout { valid_range: 0..=4294967295, }, ), - largest_niche: None, - align: AbiAndPrefAlign { - abi: Align(4 bytes), - pref: $PREF_ALIGN, - }, - size: Size(8 bytes), - }, - Layout { fields: Arbitrary { offsets: [ Size(4 bytes), @@ -216,8 +233,16 @@ error: layout_of(std::result::Result<i32, i32>) = Layout { 0, ], }, + largest_niche: None, variants: Single { - index: 1, + index: 0, + }, + }, + Layout { + size: Size(8 bytes), + align: AbiAndPrefAlign { + abi: Align(4 bytes), + pref: $PREF_ALIGN, }, abi: ScalarPair( Initialized { @@ -235,46 +260,21 @@ error: layout_of(std::result::Result<i32, i32>) = Layout { valid_range: 0..=4294967295, }, ), + fields: Arbitrary { + offsets: [ + Size(4 bytes), + ], + memory_index: [ + 0, + ], + }, largest_niche: None, - align: AbiAndPrefAlign { - abi: Align(4 bytes), - pref: $PREF_ALIGN, + variants: Single { + index: 1, }, - size: Size(8 bytes), }, ], }, - abi: ScalarPair( - Initialized { - value: Int( - I32, - false, - ), - valid_range: 0..=1, - }, - Initialized { - value: Int( - I32, - true, - ), - valid_range: 0..=4294967295, - }, - ), - largest_niche: Some( - Niche { - offset: Size(0 bytes), - value: Int( - I32, - false, - ), - valid_range: 0..=1, - }, - ), - align: AbiAndPrefAlign { - abi: Align(4 bytes), - pref: $PREF_ALIGN, - }, - size: Size(8 bytes), } --> $DIR/debug.rs:15:1 | @@ -282,9 +282,10 @@ LL | type Test = Result<i32, i32>; | ^^^^^^^^^ error: layout_of(i32) = Layout { - fields: Primitive, - variants: Single { - index: 0, + size: Size(4 bytes), + align: AbiAndPrefAlign { + abi: Align(4 bytes), + pref: $PREF_ALIGN, }, abi: Scalar( Initialized { @@ -295,12 +296,11 @@ error: layout_of(i32) = Layout { valid_range: 0..=4294967295, }, ), + fields: Primitive, largest_niche: None, - align: AbiAndPrefAlign { - abi: Align(4 bytes), - pref: $PREF_ALIGN, + variants: Single { + index: 0, }, - size: Size(4 bytes), } --> $DIR/debug.rs:18:1 | |
