From 270ebfcdf5e08dca9ab7fe5ecb764bfadc4916cc Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Fri, 10 Apr 2026 22:42:12 -0400 Subject: [PATCH] Tweak comment about intrinsics in cross-crate-inlinable --- compiler/rustc_mir_transform/src/cross_crate_inline.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_mir_transform/src/cross_crate_inline.rs b/compiler/rustc_mir_transform/src/cross_crate_inline.rs index 53aa5f450dbb..644f2d22ef7f 100644 --- a/compiler/rustc_mir_transform/src/cross_crate_inline.rs +++ b/compiler/rustc_mir_transform/src/cross_crate_inline.rs @@ -146,8 +146,9 @@ fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, _: Location) { TerminatorKind::Call { func, unwind, .. } => { // We track calls because they make our function not a leaf (and in theory, the // number of calls indicates how likely this function is to perturb other CGUs). - // But intrinsics don't have a body that gets assigned to a CGU, so they are - // ignored. + // But there are a handful of intrinsics such as raw_eq that should not block + // cross-crate-inlining. Adding a broad exception for all intrinsics benchmarks well + // and seems more sustainable than an ever-growing list of intrinsics to ignore. if let Some((fn_def_id, _)) = func.const_fn_def() && find_attr!(tcx, fn_def_id, RustcIntrinsic) {