mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 09:53:04 +03:00
Improve error message when we try to get_type on something that does not have a type
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user