EntryKind::Trait(_) => Def::Trait(did),
EntryKind::Enum(..) => Def::Enum(did),
EntryKind::MacroDef(_) => Def::Macro(did, MacroKind::Bang),
+ EntryKind::GlobalAsm => Def::GlobalAsm(did),
EntryKind::ForeignMod |
EntryKind::Impl(_) |
}
}
- pub fn get_trait_def(&self,
- item_id: DefIndex,
- tcx: TyCtxt<'a, 'tcx, 'tcx>)
- -> ty::TraitDef {
+ pub fn get_trait_def(&self, item_id: DefIndex) -> ty::TraitDef {
let data = match self.entry(item_id).kind {
EntryKind::Trait(data) => data.decode(self),
_ => bug!(),
let def = ty::TraitDef::new(self.local_def_id(item_id),
data.unsafety,
data.paren_sugar,
- self.def_path(item_id).deterministic_hash(tcx));
+ self.def_path_table.def_path_hash(item_id));
if data.has_default_impl {
def.record_has_default_impl();
}
}
+ #[inline]
pub fn def_key(&self, index: DefIndex) -> DefKey {
self.def_path_table.def_key(index)
}
DefPath::make(self.cnum, id, |parent| self.def_path_table.def_key(parent))
}
+ #[inline]
+ pub fn def_path_hash(&self, index: DefIndex) -> u64 {
+ self.def_path_table.def_path_hash(index)
+ }
+
/// Imports the codemap from an external crate into the codemap of the crate
/// currently being compiled (the "local crate").
///