Add track_caller to DefId::expect_local()

This commit is contained in:
Yuki Okushi 2022-05-06 07:28:06 +09:00
parent 30f3860875
commit 2ed38cdbdd
No known key found for this signature in database
GPG Key ID: 379CEEFDD63E5DD7

View File

@ -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))
}