diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs index 171060ccfb1..6dd1ed598e3 100644 --- a/compiler/rustc_const_eval/src/interpret/step.rs +++ b/compiler/rustc_const_eval/src/interpret/step.rs @@ -496,7 +496,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { } ty::FnDef(def_id, args) => { let instance = self.resolve(def_id, args.no_bound_vars().unwrap())?; - // Don't compute FnAbi for LLVM intrinsics. Trying to that would panic. + // Don't compute FnAbi for LLVM intrinsics. Trying to do that would panic. + // Rust intrinsics however *do* need a FnAbi as we may invoke the + // fallback body like a regular function. let has_fn_abi = !matches!(instance.def, ty::InstanceKind::LlvmIntrinsic(_)); ( FnVal::Instance(instance), diff --git a/compiler/rustc_monomorphize/src/mono_checks/abi_check.rs b/compiler/rustc_monomorphize/src/mono_checks/abi_check.rs index e342eb07c41..5f44e2e2888 100644 --- a/compiler/rustc_monomorphize/src/mono_checks/abi_check.rs +++ b/compiler/rustc_monomorphize/src/mono_checks/abi_check.rs @@ -223,6 +223,7 @@ fn check_call_site_abi<'tcx>( DUMMY_SP, ); if let InstanceKind::LlvmIntrinsic(..) = instance.def { + // LLVM intrinsics don't have an ABI, so there is nothing to check. return; } tcx.fn_abi_of_instance(typing_env.as_query_input((instance, ty::List::empty())))