about summary refs log tree commit diff
path: root/compiler/rustc_transmute
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-28 10:18:50 -0700
committerGitHub <noreply@github.com>2024-10-28 10:18:50 -0700
commit259ddf9b50df634962320fcd3cca2c7395cf7b0d (patch)
tree2432f2e597f06d612c1caef1220e567d9ab7cfbe /compiler/rustc_transmute
parentd6be363400ce8041808cd1aee6e77db49079cd25 (diff)
parent641ce068ae6f26eee5b455cf0110ba2ed370d384 (diff)
downloadrust-259ddf9b50df634962320fcd3cca2c7395cf7b0d.tar.gz
rust-259ddf9b50df634962320fcd3cca2c7395cf7b0d.zip
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.
Diffstat (limited to 'compiler/rustc_transmute')
-rw-r--r--compiler/rustc_transmute/src/layout/tree.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_transmute/src/layout/tree.rs b/compiler/rustc_transmute/src/layout/tree.rs
index 94ca4c13d08..f19a567cd84 100644
--- a/compiler/rustc_transmute/src/layout/tree.rs
+++ b/compiler/rustc_transmute/src/layout/tree.rs
@@ -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