about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2025-02-01 17:46:40 -0500
committerBen Kimock <kimockb@gmail.com>2025-03-24 20:29:24 -0400
commit817e2c598d01c1c4abc7ae67731432df2cf1047c (patch)
treef1437656e3574af7f845c1aef847bf04ce4b0b90 /compiler/rustc_codegen_ssa/src/back
parent8ad2c9724d983cfb116baab0bb800edd17f31644 (diff)
downloadrust-817e2c598d01c1c4abc7ae67731432df2cf1047c.tar.gz
rust-817e2c598d01c1c4abc7ae67731432df2cf1047c.zip
Remove InstanceKind::generates_cgu_internal_copy
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/symbol_export.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs
index f8f7bb2dbc6..76b0a566f8e 100644
--- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs
+++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs
@@ -93,16 +93,11 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S
                 return None;
             }
 
-            // Functions marked with #[inline] are codegened with "internal"
-            // linkage and are not exported unless marked with an extern
-            // indicator
-            if !Instance::mono(tcx, def_id.to_def_id()).def.generates_cgu_internal_copy(tcx)
-                || tcx.codegen_fn_attrs(def_id.to_def_id()).contains_extern_indicator()
-            {
-                Some(def_id)
-            } else {
-                None
+            if Instance::mono(tcx, def_id.into()).def.requires_inline(tcx) {
+                return None;
             }
+
+            if tcx.cross_crate_inlinable(def_id) { None } else { Some(def_id) }
         })
         .map(|def_id| {
             // We won't link right if this symbol is stripped during LTO.