mirror of
https://github.com/rust-lang/rust
synced 2024-10-22 00:14:09 +00:00
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
|
@ -947,7 +947,12 @@ fn get_generics(&self, item_id: DefIndex, sess: &Session) -> ty::Generics {
|
|||
}
|
||||
|
||||
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> {
|
||||
|
|
Loading…
Reference in a new issue