Auto merge of #115602 - oli-obk:lower_intrinsics, r=petrochenkov
Don't report any errors in `lower_intrinsics`. Intrinsics should have been type checked earlier. This is part of moving all mir-opt diagnostics early enough so that they are reliably emitted even in check builds: https://github.com/rust-lang/rust/issues/49292#issuecomment-1692212095
This commit is contained in:
commit
c5775a776f
6 changed files with 30 additions and 29 deletions
|
@ -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