Skip to content

Commit c7db4b0

Browse files
committed
Apply track_caller to closure on expect_non_local()
1 parent 16a0d03 commit c7db4b0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler/rustc_hir/src/def.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,10 @@ impl<Id> Res<Id> {
671671

672672
#[track_caller]
673673
pub fn expect_non_local<OtherId>(self) -> Res<OtherId> {
674-
self.map_id(|_| panic!("unexpected `Res::Local`"))
674+
self.map_id(
675+
#[track_caller]
676+
|_| panic!("unexpected `Res::Local`"),
677+
)
675678
}
676679

677680
pub fn macro_kind(self) -> Option<MacroKind> {

compiler/rustc_hir/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html
44
55
#![feature(associated_type_defaults)]
6+
#![feature(closure_track_caller)]
67
#![feature(const_btree_new)]
78
#![feature(let_else)]
89
#![feature(once_cell)]

0 commit comments

Comments
 (0)