Skip to content

Commit

Permalink
Apply track_caller to closure on expect_non_local()
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed May 31, 2022
1 parent 16a0d03 commit c7db4b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/rustc_hir/src/def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,10 @@ impl<Id> Res<Id> {

#[track_caller]
pub fn expect_non_local<OtherId>(self) -> Res<OtherId> {
self.map_id(|_| panic!("unexpected `Res::Local`"))
self.map_id(
#[track_caller]
|_| panic!("unexpected `Res::Local`"),
)
}

pub fn macro_kind(self) -> Option<MacroKind> {
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html

#![feature(associated_type_defaults)]
#![feature(closure_track_caller)]
#![feature(const_btree_new)]
#![feature(let_else)]
#![feature(once_cell)]
Expand Down

0 comments on commit c7db4b0

Please sign in to comment.