summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-17 09:39:26 +0000
committerbors <bors@rust-lang.org>2022-05-17 09:39:26 +0000
commit735efc0c703812343a5e5d19b600dac73b8a89f0 (patch)
tree59db2d0d1eba880d8a0b83c2e1a64d346a288551 /compiler/rustc_const_eval/src/interpret
parent7355d971a954ed63293e4191f6677f60c1bc07d9 (diff)
parent0a6b69106eb1df116404a3be123baf100e6cdf21 (diff)
downloadrust-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_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/terminator.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/terminator.rs b/compiler/rustc_const_eval/src/interpret/terminator.rs
index c2664565f15..25f9d4baca3 100644
--- a/compiler/rustc_const_eval/src/interpret/terminator.rs
+++ b/compiler/rustc_const_eval/src/interpret/terminator.rs
@@ -312,8 +312,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         };
 
         match instance.def {
-            ty::InstanceDef::Intrinsic(..) => {
-                assert!(caller_abi == Abi::RustIntrinsic || caller_abi == Abi::PlatformIntrinsic);
+            ty::InstanceDef::Intrinsic(def_id) => {
+                assert!(self.tcx.is_intrinsic(def_id));
                 // caller_fn_abi is not relevant here, we interpret the arguments directly for each intrinsic.
                 M::call_intrinsic(self, instance, args, ret, unwind)
             }