mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-29 03:37:26 +03:00
Add track_caller to DefId::expect_local()
This commit is contained in:
@@ -279,6 +279,7 @@ pub fn as_local(self) -> Option<LocalDefId> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[track_caller]
|
||||
pub fn expect_local(self) -> LocalDefId {
|
||||
self.as_local().unwrap_or_else(|| panic!("DefId::expect_local: `{:?}` isn't local", self))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user