Rollup merge of #132255 - workingjubilee:layout-is-🏚️, r=compiler-errors
Add `LayoutS::is_uninhabited` and use it Use accessors for the things that accessors are good at: reducing everyone's need to be nosy and peek at the internals of every data structure.
This commit is contained in:
commit
259ddf9b50
21 changed files with 44 additions and 41 deletions
|
@ -339,9 +339,7 @@ pub(crate) mod rustc {
|
|||
// 2. enums that delegate their layout to a variant
|
||||
// 3. enums with multiple variants
|
||||
match layout.variants() {
|
||||
Variants::Single { .. }
|
||||
if layout.abi.is_uninhabited() && layout.size == Size::ZERO =>
|
||||
{
|
||||
Variants::Single { .. } if layout.is_uninhabited() && layout.size == Size::ZERO => {
|
||||
// The layout representation of uninhabited, ZST enums is
|
||||
// defined to be like that of the `!` type, as opposed of a
|
||||
// typical enum. Consequently, they cannot be descended into
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue