Don't report any errors in lower_intrinsics
. They should have been typecked before.
This commit is contained in:
parent
3767e315ac
commit
65f25fe194
6 changed files with 30 additions and 29 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue