forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable dead variant removal for
#[repr(C)]
enums.
- Loading branch information
1 parent
1a851da
commit d34e10c
Showing
10 changed files
with
1,520 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
284 changes: 284 additions & 0 deletions
284
tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,284 @@ | ||
error: layout_of(Univariant) = Layout { | ||
size: Size(4 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: Align(4 bytes), | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: Uninhabited, | ||
fields: Arbitrary { | ||
offsets: [ | ||
Size(0 bytes), | ||
], | ||
memory_index: [ | ||
0, | ||
], | ||
}, | ||
largest_niche: Some( | ||
Niche { | ||
offset: Size(0 bytes), | ||
value: Int( | ||
I32, | ||
false, | ||
), | ||
valid_range: 0..=0, | ||
}, | ||
), | ||
variants: Multiple { | ||
tag: Initialized { | ||
value: Int( | ||
I32, | ||
false, | ||
), | ||
valid_range: 0..=0, | ||
}, | ||
tag_encoding: Direct, | ||
tag_field: 0, | ||
variants: [ | ||
Layout { | ||
size: Size(4 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: Align(4 bytes), | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: Uninhabited, | ||
fields: Arbitrary { | ||
offsets: [ | ||
Size(4 bytes), | ||
], | ||
memory_index: [ | ||
0, | ||
], | ||
}, | ||
largest_niche: None, | ||
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/repr-c-dead-variants.rs:38:1 | ||
| | ||
LL | enum Univariant { | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: layout_of(TwoVariants) = Layout { | ||
size: Size(8 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: Align(4 bytes), | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: ScalarPair( | ||
Initialized { | ||
value: Int( | ||
I32, | ||
false, | ||
), | ||
valid_range: 0..=1, | ||
}, | ||
Union { | ||
value: Int( | ||
I8, | ||
false, | ||
), | ||
}, | ||
), | ||
fields: Arbitrary { | ||
offsets: [ | ||
Size(0 bytes), | ||
], | ||
memory_index: [ | ||
0, | ||
], | ||
}, | ||
largest_niche: Some( | ||
Niche { | ||
offset: Size(0 bytes), | ||
value: Int( | ||
I32, | ||
false, | ||
), | ||
valid_range: 0..=1, | ||
}, | ||
), | ||
variants: Multiple { | ||
tag: Initialized { | ||
value: Int( | ||
I32, | ||
false, | ||
), | ||
valid_range: 0..=1, | ||
}, | ||
tag_encoding: Direct, | ||
tag_field: 0, | ||
variants: [ | ||
Layout { | ||
size: Size(4 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: Align(4 bytes), | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: Uninhabited, | ||
fields: Arbitrary { | ||
offsets: [ | ||
Size(4 bytes), | ||
], | ||
memory_index: [ | ||
0, | ||
], | ||
}, | ||
largest_niche: None, | ||
variants: Single { | ||
index: 0, | ||
}, | ||
max_repr_align: None, | ||
unadjusted_abi_align: Align(4 bytes), | ||
}, | ||
Layout { | ||
size: Size(8 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: Align(4 bytes), | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: ScalarPair( | ||
Initialized { | ||
value: Int( | ||
I32, | ||
false, | ||
), | ||
valid_range: 0..=1, | ||
}, | ||
Union { | ||
value: Int( | ||
I8, | ||
false, | ||
), | ||
}, | ||
), | ||
fields: Arbitrary { | ||
offsets: [ | ||
Size(4 bytes), | ||
], | ||
memory_index: [ | ||
0, | ||
], | ||
}, | ||
largest_niche: None, | ||
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/repr-c-dead-variants.rs:45:1 | ||
| | ||
LL | enum TwoVariants { | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: layout_of(DeadBranchHasOtherField) = Layout { | ||
size: Size(16 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: Align(8 bytes), | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: Aggregate { | ||
sized: true, | ||
}, | ||
fields: Arbitrary { | ||
offsets: [ | ||
Size(0 bytes), | ||
], | ||
memory_index: [ | ||
0, | ||
], | ||
}, | ||
largest_niche: Some( | ||
Niche { | ||
offset: Size(0 bytes), | ||
value: Int( | ||
I32, | ||
false, | ||
), | ||
valid_range: 0..=1, | ||
}, | ||
), | ||
variants: Multiple { | ||
tag: Initialized { | ||
value: Int( | ||
I32, | ||
false, | ||
), | ||
valid_range: 0..=1, | ||
}, | ||
tag_encoding: Direct, | ||
tag_field: 0, | ||
variants: [ | ||
Layout { | ||
size: Size(16 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: Align(8 bytes), | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: Uninhabited, | ||
fields: Arbitrary { | ||
offsets: [ | ||
Size(8 bytes), | ||
Size(8 bytes), | ||
], | ||
memory_index: [ | ||
0, | ||
1, | ||
], | ||
}, | ||
largest_niche: None, | ||
variants: Single { | ||
index: 0, | ||
}, | ||
max_repr_align: None, | ||
unadjusted_abi_align: Align(8 bytes), | ||
}, | ||
Layout { | ||
size: Size(16 bytes), | ||
align: AbiAndPrefAlign { | ||
abi: Align(8 bytes), | ||
pref: $SOME_ALIGN, | ||
}, | ||
abi: Aggregate { | ||
sized: true, | ||
}, | ||
fields: Arbitrary { | ||
offsets: [ | ||
Size(8 bytes), | ||
], | ||
memory_index: [ | ||
0, | ||
], | ||
}, | ||
largest_niche: None, | ||
variants: Single { | ||
index: 1, | ||
}, | ||
max_repr_align: None, | ||
unadjusted_abi_align: Align(8 bytes), | ||
}, | ||
], | ||
}, | ||
max_repr_align: None, | ||
unadjusted_abi_align: Align(8 bytes), | ||
} | ||
--> $DIR/repr-c-dead-variants.rs:53:1 | ||
| | ||
LL | enum DeadBranchHasOtherField { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
Oops, something went wrong.