Add a scheme for moving away from extern "rust-intrinsic"
entirely
This commit is contained in:
parent
f2612daf58
commit
1e57df1969
16 changed files with 131 additions and 8 deletions
|
@ -16,6 +16,7 @@ use rustc_middle::ty::{self, SymbolName, TyCtxt};
|
|||
use rustc_middle::ty::{GenericArgKind, GenericArgsRef};
|
||||
use rustc_middle::util::Providers;
|
||||
use rustc_session::config::{CrateType, OomStrategy};
|
||||
use rustc_span::sym;
|
||||
use rustc_target::spec::{SanitizerSet, TlsModel};
|
||||
|
||||
pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
|
||||
|
@ -81,6 +82,10 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S
|
|||
return library.kind.is_statically_included().then_some(def_id);
|
||||
}
|
||||
|
||||
if tcx.has_attr(def_id, sym::rustc_intrinsic_must_be_overridden) {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Only consider nodes that actually have exported symbols.
|
||||
match tcx.def_kind(def_id) {
|
||||
DefKind::Fn | DefKind::Static(_) => {}
|
||||
|
|
|
@ -903,7 +903,16 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
MergingSucc::False
|
||||
};
|
||||
}
|
||||
Err(instance) => Some(instance),
|
||||
Err(instance) => {
|
||||
if intrinsic.must_be_overridden {
|
||||
span_bug!(
|
||||
span,
|
||||
"intrinsic {} must be overridden by codegen backend, but isn't",
|
||||
intrinsic.name,
|
||||
);
|
||||
}
|
||||
Some(instance)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue