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
+1
View File
@@ -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))
}