Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2b8963a

Browse files
committed
Some manual formatting of let..else statements
1 parent 2a94a2d commit 2b8963a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

compiler/rustc_ty_utils/src/layout.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ fn layout_of_uncached<'tcx>(
325325

326326
// Extract the number of elements from the layout of the array field:
327327
let FieldsShape::Array { count, .. } = cx.layout_of(f0_ty)?.layout.fields() else {
328-
return Err(LayoutError::Unknown(ty));
329-
};
328+
return Err(LayoutError::Unknown(ty));
329+
};
330330

331331
(*e_ty, *count, true)
332332
} else {
@@ -351,14 +351,14 @@ fn layout_of_uncached<'tcx>(
351351
// Compute the ABI of the element type:
352352
let e_ly = cx.layout_of(e_ty)?;
353353
let Abi::Scalar(e_abi) = e_ly.abi else {
354-
// This error isn't caught in typeck, e.g., if
355-
// the element type of the vector is generic.
356-
tcx.sess.fatal(&format!(
357-
"monomorphising SIMD type `{}` with a non-primitive-scalar \
358-
(integer/float/pointer) element type `{}`",
359-
ty, e_ty
360-
))
361-
};
354+
// This error isn't caught in typeck, e.g., if
355+
// the element type of the vector is generic.
356+
tcx.sess.fatal(&format!(
357+
"monomorphising SIMD type `{}` with a non-primitive-scalar \
358+
(integer/float/pointer) element type `{}`",
359+
ty, e_ty
360+
))
361+
};
362362

363363
// Compute the size and alignment of the vector:
364364
let size = e_ly.size.checked_mul(e_len, dl).ok_or(LayoutError::SizeOverflow(ty))?;
@@ -597,8 +597,8 @@ fn generator_layout<'tcx>(
597597
let subst_field = |ty: Ty<'tcx>| EarlyBinder(ty).subst(tcx, substs);
598598

599599
let Some(info) = tcx.generator_layout(def_id) else {
600-
return Err(LayoutError::Unknown(ty));
601-
};
600+
return Err(LayoutError::Unknown(ty));
601+
};
602602
let (ineligible_locals, assignments) = generator_saved_local_eligibility(&info);
603603

604604
// Build a prefix layout, including "promoting" all ineligible
@@ -701,8 +701,8 @@ fn generator_layout<'tcx>(
701701
variant.variants = Variants::Single { index };
702702

703703
let FieldsShape::Arbitrary { offsets, memory_index } = variant.fields else {
704-
bug!();
705-
};
704+
bug!();
705+
};
706706

707707
// Now, stitch the promoted and variant-only fields back together in
708708
// the order they are mentioned by our GeneratorLayout.

0 commit comments

Comments
 (0)