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
|
@ -5,6 +5,8 @@ use super::TyCtxt;
|
|||
#[derive(Copy, Clone, Debug, Decodable, Encodable, HashStable)]
|
||||
pub struct IntrinsicDef {
|
||||
pub name: Symbol,
|
||||
/// Whether the intrinsic has no meaningful body and all backends need to shim all calls to it.
|
||||
pub must_be_overridden: bool,
|
||||
}
|
||||
|
||||
impl TyCtxt<'_> {
|
||||
|
|
|
@ -1646,7 +1646,10 @@ pub fn intrinsic(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ty::IntrinsicDef
|
|||
if matches!(tcx.fn_sig(def_id).skip_binder().abi(), Abi::RustIntrinsic)
|
||||
|| tcx.has_attr(def_id, sym::rustc_intrinsic)
|
||||
{
|
||||
Some(ty::IntrinsicDef { name: tcx.item_name(def_id.into()) })
|
||||
Some(ty::IntrinsicDef {
|
||||
name: tcx.item_name(def_id.into()),
|
||||
must_be_overridden: tcx.has_attr(def_id, sym::rustc_intrinsic_must_be_overridden),
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue