about summary refs log tree commit diff
path: root/src
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 /src
parentd6be363400ce8041808cd1aee6e77db49079cd25 (diff)
parent641ce068ae6f26eee5b455cf0110ba2ed370d384 (diff)
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 'src')
-rw-r--r--src/librustdoc/html/render/type_layout.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/html/render/type_layout.rs b/src/librustdoc/html/render/type_layout.rs
index cd4e597ff28..79209cee94f 100644
--- a/src/librustdoc/html/render/type_layout.rs
+++ b/src/librustdoc/html/render/type_layout.rs
@@ -60,8 +60,8 @@ pub(crate) fn document_type_layout<'a, 'cx: 'a>(
                         span_bug!(tcx.def_span(ty_def_id), "not an adt")
                     };
                     let name = adt.variant(variant_idx).name;
-                    let is_unsized = variant_layout.abi.is_unsized();
-                    let is_uninhabited = variant_layout.abi.is_uninhabited();
+                    let is_unsized = variant_layout.is_unsized();
+                    let is_uninhabited = variant_layout.is_uninhabited();
                     let size = variant_layout.size.bytes() - tag_size;
                     let type_layout_size = TypeLayoutSize { is_unsized, is_uninhabited, size };
                     (name, type_layout_size)
@@ -72,8 +72,8 @@ pub(crate) fn document_type_layout<'a, 'cx: 'a>(
         };
 
         let type_layout_size = tcx.layout_of(param_env.and(ty)).map(|layout| {
-            let is_unsized = layout.abi.is_unsized();
-            let is_uninhabited = layout.abi.is_uninhabited();
+            let is_unsized = layout.is_unsized();
+            let is_uninhabited = layout.is_uninhabited();
             let size = layout.size.bytes();
             TypeLayoutSize { is_unsized, is_uninhabited, size }
         });