Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs10
-rw-r--r--crates/hir-ty/src/layout.rs14
2 files changed, 12 insertions, 12 deletions
diff --git a/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs b/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs
index 3312da470c..91eb59fb31 100644
--- a/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs
+++ b/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs
@@ -361,11 +361,11 @@ impl PatCx for MatchCheckCtx<'_> {
}
}
- fn ctor_sub_tys<'a>(
- &'a self,
- ctor: &'a rustc_pattern_analysis::constructor::Constructor<Self>,
- ty: &'a Self::Ty,
- ) -> impl ExactSizeIterator<Item = (Self::Ty, PrivateUninhabitedField)> + Captures<'a> {
+ fn ctor_sub_tys(
+ &self,
+ ctor: &rustc_pattern_analysis::constructor::Constructor<Self>,
+ ty: &Self::Ty,
+ ) -> impl ExactSizeIterator<Item = (Self::Ty, PrivateUninhabitedField)> {
let single = |ty| smallvec![(ty, PrivateUninhabitedField(false))];
let tys: SmallVec<[_; 2]> = match ctor {
Struct | Variant(_) | UnionField => match ty.kind(Interner) {
diff --git a/crates/hir-ty/src/layout.rs b/crates/hir-ty/src/layout.rs
index b6f7c44c2a..a72bcad50a 100644
--- a/crates/hir-ty/src/layout.rs
+++ b/crates/hir-ty/src/layout.rs
@@ -179,7 +179,7 @@ fn layout_of_simd_ty(
.size
.checked_mul(e_len, dl)
.ok_or(LayoutError::BadCalc(LayoutCalculatorError::SizeOverflow))?;
- let align = dl.vector_align(size);
+ let align = dl.llvmlike_vector_align(size);
let size = size.align_to(align.abi);
// Compute the placement of the vector fields:
@@ -194,6 +194,7 @@ fn layout_of_simd_ty(
fields,
backend_repr: BackendRepr::Vector { element: e_abi, count: e_len },
largest_niche: e_ly.largest_niche,
+ uninhabited: false,
size,
align,
max_repr_align: None,
@@ -297,20 +298,17 @@ pub fn layout_of_ty_query(
.checked_mul(count, dl)
.ok_or(LayoutError::BadCalc(LayoutCalculatorError::SizeOverflow))?;
- let backend_repr =
- if count != 0 && matches!(element.backend_repr, BackendRepr::Uninhabited) {
- BackendRepr::Uninhabited
- } else {
- BackendRepr::Memory { sized: true }
- };
+ let backend_repr = BackendRepr::Memory { sized: true };
let largest_niche = if count != 0 { element.largest_niche } else { None };
+ let uninhabited = if count != 0 { element.uninhabited } else { false };
Layout {
variants: Variants::Single { index: struct_variant_idx() },
fields: FieldsShape::Array { stride: element.size, count },
backend_repr,
largest_niche,
+ uninhabited,
align: element.align,
size,
max_repr_align: None,
@@ -325,6 +323,7 @@ pub fn layout_of_ty_query(
fields: FieldsShape::Array { stride: element.size, count: 0 },
backend_repr: BackendRepr::Memory { sized: false },
largest_niche: None,
+ uninhabited: false,
align: element.align,
size: Size::ZERO,
max_repr_align: None,
@@ -337,6 +336,7 @@ pub fn layout_of_ty_query(
fields: FieldsShape::Array { stride: Size::from_bytes(1), count: 0 },
backend_repr: BackendRepr::Memory { sized: false },
largest_niche: None,
+ uninhabited: false,
align: dl.i8_align,
size: Size::ZERO,
max_repr_align: None,