Skip to content

Commit 1158a84

Browse files
committed
#[track_caller] suppresses MIR inlining.
1 parent a43cf7f commit 1158a84

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustc_mir/transform/inline.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ impl Inliner<'tcx> {
234234

235235
let codegen_fn_attrs = tcx.codegen_fn_attrs(callsite.callee);
236236

237+
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::TRACK_CALLER) {
238+
debug!("`#[track_caller]` present - not inlining");
239+
return false;
240+
}
241+
237242
let hinted = match codegen_fn_attrs.inline {
238243
// Just treat inline(always) as a hint for now,
239244
// there are cases that prevent inlining that we

0 commit comments

Comments
 (0)