Skip to content

Commit 24932d6

Browse files
committed
Mark functions with custom inline attribute as candidates for inlining
1 parent 5dd1877 commit 24932d6

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

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

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

0 commit comments

Comments
 (0)