Skip to content

Commit 900fcfd

Browse files
authored
Rollup merge of rust-lang#146667 - calebzulawski:simd-mono-lane-limit, r=lcnr,RalfJung
Add an attribute to check the number of lanes in a SIMD vector after monomorphization Allows std::simd to drop the `LaneCount<N>: SupportedLaneCount` trait and maintain good error messages. Also, extends rust-lang#145967 by including spans in layout errors for all ADTs. r? ``@RalfJung`` cc ``@workingjubilee`` ``@programmerjake``
2 parents 465d04a + 994d3e1 commit 900fcfd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/context.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,10 @@ impl<'gcc, 'tcx> HasX86AbiOpt for CodegenCx<'gcc, 'tcx> {
529529
impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
530530
#[inline]
531531
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
532-
if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
532+
if let LayoutError::SizeOverflow(_)
533+
| LayoutError::InvalidSimd { .. }
534+
| LayoutError::ReferencesError(_) = err
535+
{
533536
self.tcx.dcx().emit_fatal(respan(span, err.into_diagnostic()))
534537
} else {
535538
self.tcx.dcx().emit_fatal(ssa_errors::FailedToGetLayout { span, ty, err })
@@ -545,7 +548,9 @@ impl<'gcc, 'tcx> FnAbiOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
545548
span: Span,
546549
fn_abi_request: FnAbiRequest<'tcx>,
547550
) -> ! {
548-
if let FnAbiError::Layout(LayoutError::SizeOverflow(_)) = err {
551+
if let FnAbiError::Layout(LayoutError::SizeOverflow(_) | LayoutError::InvalidSimd { .. }) =
552+
err
553+
{
549554
self.tcx.dcx().emit_fatal(respan(span, err))
550555
} else {
551556
match fn_abi_request {

0 commit comments

Comments
 (0)