InstanceDef::requires_caller_location limited to items.

This commit is contained in:
Adam Perry 2020-01-16 19:23:45 -08:00
parent fd90e56120
commit 0ee922123f

View File

@ -141,7 +141,12 @@ impl<'tcx> InstanceDef<'tcx> {
}
pub fn requires_caller_location(&self, tcx: TyCtxt<'_>) -> bool {
tcx.codegen_fn_attrs(self.def_id()).flags.contains(CodegenFnAttrFlags::TRACK_CALLER)
match *self {
InstanceDef::Item(def_id) => {
tcx.codegen_fn_attrs(def_id).flags.contains(CodegenFnAttrFlags::TRACK_CALLER)
}
_ => false,
}
}
}