Skip to content

Commit

Permalink
Add track_caller to DefId::expect_local()
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed May 5, 2022
1 parent 30f3860 commit 2ed38cd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_span/src/def_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ impl DefId {
}

#[inline]
#[track_caller]
pub fn expect_local(self) -> LocalDefId {
self.as_local().unwrap_or_else(|| panic!("DefId::expect_local: `{:?}` isn't local", self))
}
Expand Down

0 comments on commit 2ed38cd

Please sign in to comment.