Skip to content

Commit cc574be

Browse files
committed
#[track_caller] suppresses MIR inlining.
1 parent 28b2257 commit cc574be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustc_mir/transform/inline.rs

+5
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ impl Inliner<'tcx> {
230230

231231
let codegen_fn_attrs = tcx.codegen_fn_attrs(callsite.callee);
232232

233+
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::TRACK_CALLER) {
234+
debug!("`#[track_caller]` present - not inlining");
235+
return false;
236+
}
237+
233238
let hinted = match codegen_fn_attrs.inline {
234239
// Just treat inline(always) as a hint for now,
235240
// there are cases that prevent inlining that we

0 commit comments

Comments
 (0)