Skip to content

Commit 33ecef0

Browse files
committed
codegen_attrs: force inlining takes precedence
1 parent 397f519 commit 33ecef0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,12 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
544544
Some(MetaItemKind::NameValue(_)) => ia,
545545
None => ia,
546546
}
547-
} else if attr.has_name(sym::rustc_force_inline) && tcx.features().rustc_attrs() {
547+
} else {
548+
ia
549+
}
550+
});
551+
codegen_fn_attrs.inline = attrs.iter().fold(codegen_fn_attrs.inline, |ia, attr| {
552+
if attr.has_name(sym::rustc_force_inline) && tcx.features().rustc_attrs() {
548553
match attr.meta_kind() {
549554
Some(MetaItemKind::NameValue(lit)) => {
550555
InlineAttr::Force { attr_span: attr.span, reason: Some(lit.symbol) }

0 commit comments

Comments
 (0)