-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The InstanceDef::requires_inline
is described to return true if "this
instance is unconditionally marked with inline". In practice, the instance will
receive an inline hint if and only if the instance has any other user specified
inlining attributes.
For example, by default a closure will not receive an inline hint, but a
closure marked with #[inline(never)]
counter-intuitively will (together with
noinline
).
#![crate_type = "lib"]
#![feature(stmt_expr_attributes)]
pub fn f() {
let a = || {};
let b = #[inline(never)] || {};
a();
b();
}
; a::f::{{closure}}
; Function Attrs: nonlazybind uwtable
define internal void @"_ZN1a1f28_$u7b$$u7b$closure$u7d$$u7d$17hefe1f433f470c2abE"(%"[[email protected]:5:13: 5:18]"* noalias nonnull readonly align 1 %_1) unnamed_addr #0 {
start:
ret void
}
; a::f::{{closure}}
; Function Attrs: inlinehint noinline nonlazybind uwtable
define internal void @"_ZN1a1f28_$u7b$$u7b$closure$u7d$$u7d$17h7b2e25d54194ec9cE"(%"[[email protected]:6:30: 6:35]"* noalias nonnull readonly align 1 %_1) unnamed_addr #1 {
start:
ret void
}
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.