Improve error message when we try to get_type on something that does not have a type
This commit is contained in:
parent
071d8b14da
commit
d38dbcb19f
1 changed files with 6 additions and 1 deletions
|
@ -947,7 +947,12 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_type(&self, id: DefIndex, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
|
fn get_type(&self, id: DefIndex, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
|
||||||
self.root.tables.ty.get(self, id).unwrap().decode((self, tcx))
|
self.root
|
||||||
|
.tables
|
||||||
|
.ty
|
||||||
|
.get(self, id)
|
||||||
|
.unwrap_or_else(|| panic!("Not a type: {:?}", id))
|
||||||
|
.decode((self, tcx))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_stability(&self, id: DefIndex) -> Option<attr::Stability> {
|
fn get_stability(&self, id: DefIndex) -> Option<attr::Stability> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue