From dff98a8a144f7ebf19d8d238aed8f0e2c2375086 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 18 Nov 2024 08:41:28 +0100 Subject: [PATCH] remove pointless cold_path impl in interpreter --- compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs | 1 + compiler/rustc_const_eval/src/interpret/intrinsics.rs | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs index b92885cc1a7..6cf1cff183d 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs @@ -1264,6 +1264,7 @@ fn codegen_regular_intrinsic_call<'tcx>( sym::cold_path => { // This is a no-op. The intrinsic is just a hint to the optimizer. + // We still have an impl here to avoid it being turned into a call. } // Unimplemented intrinsics must have a fallback body. The fallback body is obtained diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs index d89d73824aa..c7a56a80e81 100644 --- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs +++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs @@ -417,9 +417,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { // These just return their argument self.copy_op(&args[0], dest)?; } - sym::cold_path => { - // This is a no-op. The intrinsic is just a hint to the optimizer. - } sym::raw_eq => { let result = self.raw_eq_intrinsic(&args[0], &args[1])?; self.write_scalar(result, dest)?;