#[track_caller] suppresses MIR inlining.

This commit is contained in:
Adam Perry 2019-10-27 15:16:46 -07:00
parent 28b2257160
commit cc574be985

View File

@ -230,6 +230,11 @@ fn should_inline(&self,
let codegen_fn_attrs = tcx.codegen_fn_attrs(callsite.callee);
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::TRACK_CALLER) {
debug!("`#[track_caller]` present - not inlining");
return false;
}
let hinted = match codegen_fn_attrs.inline {
// Just treat inline(always) as a hint for now,
// there are cases that prevent inlining that we