
Adds `#[rustc_force_inline]` which is similar to always inlining but reports an error if the inlining was not possible, and which always attempts to inline annotated items, regardless of optimisation levels. It can only be applied to free functions to guarantee that the MIR inliner will be able to resolve calls.
21 lines
499 B
Diff
21 lines
499 B
Diff
- // MIR for `caller::{closure#0}` before ForceInline
|
|
+ // MIR for `caller::{closure#0}` after ForceInline
|
|
|
|
fn caller::{closure#0}(_1: &{closure@$DIR/forced_closure.rs:10:6: 10:8}) -> () {
|
|
let mut _0: ();
|
|
let _2: ();
|
|
+ scope 1 (inlined callee_forced) {
|
|
+ }
|
|
|
|
bb0: {
|
|
StorageLive(_2);
|
|
- _2 = callee_forced() -> [return: bb1, unwind continue];
|
|
- }
|
|
-
|
|
- bb1: {
|
|
StorageDead(_2);
|
|
_0 = const ();
|
|
return;
|
|
}
|
|
}
|
|
|