Skip to content

Commit

Permalink
rustdoc: Use accessors to interrogate type layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Oct 28, 2024
1 parent 88a9edc commit 641ce06
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustdoc/html/render/type_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 }
});
Expand Down

0 comments on commit 641ce06

Please sign in to comment.