[WIP] UPDATE - migrate intrinsic.rs to new diagnostic infrastructure

WIP - replacing span_invalid_monomorphization_error function. Still in progress due to its use in codegen_llvm inside macros
This commit is contained in:
Jhonny Bill Mena 2022-11-13 14:03:22 -05:00
parent d41112a8c5
commit e26366ad99
4 changed files with 74 additions and 60 deletions

View file

@ -10,6 +10,7 @@ use crate::value::Value;
use rustc_codegen_ssa::base::{compare_simd_types, wants_msvc_seh};
use rustc_codegen_ssa::common::span_invalid_monomorphization_error;
use rustc_codegen_ssa::common::{IntPredicate, TypeKind};
use rustc_codegen_ssa::errors::InvalidMonomorphization;
use rustc_codegen_ssa::mir::operand::OperandRef;
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::traits::*;
@ -284,15 +285,11 @@ impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx> {
_ => bug!(),
},
None => {
span_invalid_monomorphization_error(
tcx.sess,
tcx.sess.emit_err(InvalidMonomorphization::BasicIntegerType {
span,
&format!(
"invalid monomorphization of `{}` intrinsic: \
expected basic integer type, found `{}`",
name, ty
),
);
name,
ty,
});
return;
}
}