1
Fork 0

Use path.def_id() in Type::inner_def_id()

This commit is contained in:
Noah Lev 2021-11-11 15:35:10 -08:00
parent 47266bacf1
commit db4a06e9bd

View file

@ -1522,7 +1522,7 @@ impl Type {
fn inner_def_id(&self, cache: Option<&Cache>) -> Option<DefId> { fn inner_def_id(&self, cache: Option<&Cache>) -> Option<DefId> {
let t: PrimitiveType = match *self { let t: PrimitiveType = match *self {
ResolvedPath { did, .. } => return Some(did), ResolvedPath { ref path, did: _ } => return Some(path.def_id()),
DynTrait(ref bounds, _) => return Some(bounds[0].trait_.def_id()), DynTrait(ref bounds, _) => return Some(bounds[0].trait_.def_id()),
Primitive(p) => return cache.and_then(|c| c.primitive_locations.get(&p).cloned()), Primitive(p) => return cache.and_then(|c| c.primitive_locations.get(&p).cloned()),
BorrowedRef { type_: box Generic(..), .. } => PrimitiveType::Reference, BorrowedRef { type_: box Generic(..), .. } => PrimitiveType::Reference,