Rollup merge of #111004 - clubby789:migrate-mir-transform, r=oli-obk
Migrate `mir_transform` to translatable diagnostics cc #100717
This commit is contained in:
commit
68594142b1
16 changed files with 470 additions and 200 deletions
|
@ -1,6 +1,6 @@
|
|||
//! Lowers intrinsic calls
|
||||
|
||||
use crate::MirPass;
|
||||
use crate::{errors, MirPass};
|
||||
use rustc_middle::mir::*;
|
||||
use rustc_middle::ty::subst::SubstsRef;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
|
@ -310,11 +310,7 @@ fn resolve_rust_intrinsic<'tcx>(
|
|||
}
|
||||
|
||||
fn validate_simd_shuffle<'tcx>(tcx: TyCtxt<'tcx>, args: &[Operand<'tcx>], span: Span) {
|
||||
match &args[2] {
|
||||
Operand::Constant(_) => {} // all good
|
||||
_ => {
|
||||
let msg = "last argument of `simd_shuffle` is required to be a `const` item";
|
||||
tcx.sess.span_err(span, msg);
|
||||
}
|
||||
if !matches!(args[2], Operand::Constant(_)) {
|
||||
tcx.sess.emit_err(errors::SimdShuffleLastConst { span });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue