Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 130ae94

Browse files
committed
Mark functions with custom inline attribute as candidates for inlining
1 parent bc5e048 commit 130ae94

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,16 @@ fn exported_symbols_provider_local(
377377
let should_export = has_generics
378378
&& (def.as_local().is_some_and(|local_did| {
379379
visibilities.public_at_level(local_did).is_some()
380-
}) || types.all(|arg| {
381-
arg.walk().all(|ty| {
382-
let Some(ty) = ty.as_type() else {
383-
return true;
384-
};
385-
!is_local_to_current_crate(ty)
386-
})
387-
}));
380+
}) || (tcx.codegen_fn_attrs(mono_item.def_id()).inline
381+
!= rustc_attr_parsing::InlineAttr::None)
382+
|| types.all(|arg| {
383+
arg.walk().all(|ty| {
384+
let Some(ty) = ty.as_type() else {
385+
return true;
386+
};
387+
!is_local_to_current_crate(ty)
388+
})
389+
}));
388390

389391
if should_export {
390392
let symbol = ExportedSymbol::Generic(def, args);

0 commit comments

Comments
 (0)