Skip to content

Commit 8aba4e6

Browse files
committed
Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData.
Also update comments that refered to BackendRepr::Uninhabited.
1 parent 99beae8 commit 8aba4e6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

crates/hir-ty/src/layout.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ fn layout_of_simd_ty(
194194
fields,
195195
backend_repr: BackendRepr::Vector { element: e_abi, count: e_len },
196196
largest_niche: e_ly.largest_niche,
197+
uninhabited: false,
197198
size,
198199
align,
199200
max_repr_align: None,
@@ -297,20 +298,17 @@ pub fn layout_of_ty_query(
297298
.checked_mul(count, dl)
298299
.ok_or(LayoutError::BadCalc(LayoutCalculatorError::SizeOverflow))?;
299300

300-
let backend_repr =
301-
if count != 0 && matches!(element.backend_repr, BackendRepr::Uninhabited) {
302-
BackendRepr::Uninhabited
303-
} else {
304-
BackendRepr::Memory { sized: true }
305-
};
301+
let backend_repr = BackendRepr::Memory { sized: true };
306302

307303
let largest_niche = if count != 0 { element.largest_niche } else { None };
304+
let uninhabited = if count != 0 { element.uninhabited } else { false };
308305

309306
Layout {
310307
variants: Variants::Single { index: struct_variant_idx() },
311308
fields: FieldsShape::Array { stride: element.size, count },
312309
backend_repr,
313310
largest_niche,
311+
uninhabited,
314312
align: element.align,
315313
size,
316314
max_repr_align: None,
@@ -325,6 +323,7 @@ pub fn layout_of_ty_query(
325323
fields: FieldsShape::Array { stride: element.size, count: 0 },
326324
backend_repr: BackendRepr::Memory { sized: false },
327325
largest_niche: None,
326+
uninhabited: false,
328327
align: element.align,
329328
size: Size::ZERO,
330329
max_repr_align: None,
@@ -337,6 +336,7 @@ pub fn layout_of_ty_query(
337336
fields: FieldsShape::Array { stride: Size::from_bytes(1), count: 0 },
338337
backend_repr: BackendRepr::Memory { sized: false },
339338
largest_niche: None,
339+
uninhabited: false,
340340
align: dl.i8_align,
341341
size: Size::ZERO,
342342
max_repr_align: None,

0 commit comments

Comments
 (0)