Closed
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"(%"[closure@a.rs: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"(%"[closure@a.rs:6:30: 6:35]"* noalias nonnull readonly align 1 %_1) unnamed_addr #1 {
start:
ret void
}