Skip to content

Commit d370964

Browse files
committed
codegen_attrs: force inlining takes precedence
1 parent b3a447a commit d370964

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,12 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
552552
Some(MetaItemKind::NameValue(_)) => ia,
553553
None => ia,
554554
}
555-
} else if attr.has_name(sym::rustc_force_inline) && tcx.features().rustc_attrs() {
555+
} else {
556+
ia
557+
}
558+
});
559+
codegen_fn_attrs.inline = attrs.iter().fold(codegen_fn_attrs.inline, |ia, attr| {
560+
if attr.has_name(sym::rustc_force_inline) && tcx.features().rustc_attrs() {
556561
match attr.meta_kind() {
557562
Some(MetaItemKind::NameValue(lit)) => {
558563
InlineAttr::Force { attr_span: attr.span, reason: Some(lit.symbol) }

0 commit comments

Comments
 (0)