Auto merge of #122037 - oli-obk:more_new_intrinsics, r=Nilstrieb

Move more intrinsics to rustc_intrinsic

cc https://github.com/rust-lang/rust/issues/63585
This commit is contained in:
bors 2024-03-19 13:10:01 +00:00
commit 200e3f7995
14 changed files with 147 additions and 128 deletions

View file

@ -23,10 +23,6 @@ fn cross_crate_inlinable(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
return false;
}
if tcx.intrinsic(def_id).is_some_and(|i| i.must_be_overridden) {
return false;
}
// This just reproduces the logic from Instance::requires_inline.
match tcx.def_kind(def_id) {
DefKind::Ctor(..) | DefKind::Closure => return true,

View file

@ -633,12 +633,6 @@ fn optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> &Body<'_> {
}
fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
if tcx.intrinsic(did).is_some_and(|i| i.must_be_overridden) {
span_bug!(
tcx.def_span(did),
"this intrinsic must be overridden by the codegen backend, it has no meaningful body",
)
}
if tcx.is_constructor(did.to_def_id()) {
// There's no reason to run all of the MIR passes on constructors when
// we can just output the MIR we want directly. This also saves const