diff options
| author | bors <bors@rust-lang.org> | 2022-05-17 09:39:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-17 09:39:26 +0000 |
| commit | 735efc0c703812343a5e5d19b600dac73b8a89f0 (patch) | |
| tree | 59db2d0d1eba880d8a0b83c2e1a64d346a288551 /compiler/rustc_ty_utils | |
| parent | 7355d971a954ed63293e4191f6677f60c1bc07d9 (diff) | |
| parent | 0a6b69106eb1df116404a3be123baf100e6cdf21 (diff) | |
| download | rust-735efc0c703812343a5e5d19b600dac73b8a89f0.tar.gz rust-735efc0c703812343a5e5d19b600dac73b8a89f0.zip | |
Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwco
Add a query for checking whether a function is an intrinsic. work towards #93145 This will reduce churn when we add more ways to declare intrinsics r? `@scottmcm`
Diffstat (limited to 'compiler/rustc_ty_utils')
| -rw-r--r-- | compiler/rustc_ty_utils/src/instance.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index 143081d61fb..17eac2bb2c9 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -5,7 +5,6 @@ use rustc_middle::traits::CodegenObligationError; use rustc_middle::ty::subst::SubstsRef; use rustc_middle::ty::{self, Binder, Instance, Ty, TyCtxt, TypeFoldable, TypeVisitor}; use rustc_span::{sym, DUMMY_SP}; -use rustc_target::spec::abi::Abi; use rustc_trait_selection::traits; use traits::{translate_substs, Reveal}; @@ -155,12 +154,7 @@ fn inner_resolve_instance<'tcx>( let item_type = tcx.subst_and_normalize_erasing_regions(substs, param_env, ty); let def = match *item_type.kind() { - ty::FnDef(..) - if { - let f = item_type.fn_sig(tcx); - f.abi() == Abi::RustIntrinsic || f.abi() == Abi::PlatformIntrinsic - } => - { + ty::FnDef(def_id, ..) if tcx.is_intrinsic(def_id) => { debug!(" => intrinsic"); ty::InstanceDef::Intrinsic(def.did) } |
