Skip to content

Commit 0ee9221

Browse files
committed
InstanceDef::requires_caller_location limited to items.
1 parent fd90e56 commit 0ee9221

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc/ty/instance.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ impl<'tcx> InstanceDef<'tcx> {
141141
}
142142

143143
pub fn requires_caller_location(&self, tcx: TyCtxt<'_>) -> bool {
144-
tcx.codegen_fn_attrs(self.def_id()).flags.contains(CodegenFnAttrFlags::TRACK_CALLER)
144+
match *self {
145+
InstanceDef::Item(def_id) => {
146+
tcx.codegen_fn_attrs(def_id).flags.contains(CodegenFnAttrFlags::TRACK_CALLER)
147+
}
148+
_ => false,
149+
}
145150
}
146151
}
147152

0 commit comments

Comments
 (0)