From 0417c4e02894e6b90cd6cf418cd997996165ae3a Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 3 Aug 2026 15:33:49 +0200 Subject: [PATCH] Add comments Co-authored-by: Ralf Jung --- compiler/rustc_const_eval/src/interpret/step.rs | 4 +++- compiler/rustc_monomorphize/src/mono_checks/abi_check.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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())))