1
Fork 0

Don't report any errors in lower_intrinsics. They should have been typecked before.

This commit is contained in:
Oli Scherer 2023-09-06 09:38:15 +00:00
parent 3767e315ac
commit 65f25fe194
6 changed files with 30 additions and 29 deletions

View file

@ -42,8 +42,6 @@ mir_transform_requires_unsafe = {$details} is unsafe and requires unsafe {$op_in
}
.not_inherited = items do not inherit unsafety from separate enclosing items
mir_transform_simd_shuffle_last_const = last argument of `simd_shuffle` is required to be a `const` item
mir_transform_target_feature_call_label = call to function with `#[target_feature]`
mir_transform_target_feature_call_note = can only be called if the required target features are available

View file

@ -258,10 +258,3 @@ pub(crate) struct MustNotSuspendReason {
pub span: Span,
pub reason: String,
}
#[derive(Diagnostic)]
#[diag(mir_transform_simd_shuffle_last_const)]
pub(crate) struct SimdShuffleLastConst {
#[primary_span]
pub span: Span,
}

View file

@ -1,11 +1,10 @@
//! Lowers intrinsic calls
use crate::{errors, MirPass};
use crate::MirPass;
use rustc_middle::mir::*;
use rustc_middle::ty::GenericArgsRef;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use rustc_target::abi::{FieldIdx, VariantIdx};
pub struct LowerIntrinsics;
@ -304,9 +303,6 @@ impl<'tcx> MirPass<'tcx> for LowerIntrinsics {
terminator.kind = TerminatorKind::Unreachable;
}
}
sym::simd_shuffle => {
validate_simd_shuffle(tcx, args, terminator.source_info.span);
}
_ => {}
}
}
@ -325,9 +321,3 @@ fn resolve_rust_intrinsic<'tcx>(
}
None
}
fn validate_simd_shuffle<'tcx>(tcx: TyCtxt<'tcx>, args: &[Operand<'tcx>], span: Span) {
if !matches!(args[2], Operand::Constant(_)) {
tcx.sess.emit_err(errors::SimdShuffleLastConst { span });
}
}