use syntax::ast;
use syntax::codemap;
use syntax::ext::base::MacroKind;
-use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP};
+use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP, NO_EXPANSION};
pub struct DecodeContext<'a, 'tcx: 'a> {
opaque: opaque::Decoder<'a>,
let sess = if let Some(sess) = self.sess {
sess
} else {
- return Ok(syntax_pos::mk_sp(lo, hi));
+ return Ok(Span { lo: lo, hi: hi, ctxt: NO_EXPANSION });
};
let (lo, hi) = if lo > hi {
let lo = (lo - filemap.original_start_pos) + filemap.translated_filemap.start_pos;
let hi = (hi - filemap.original_start_pos) + filemap.translated_filemap.start_pos;
- Ok(syntax_pos::mk_sp(lo, hi))
+ Ok(Span { lo: lo, hi: hi, ctxt: NO_EXPANSION })
}
}
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();
self.get_impl_data(id).polarity
}
- pub fn get_custom_coerce_unsized_kind(&self,
- id: DefIndex)
- -> Option<ty::adjustment::CustomCoerceUnsized> {
- self.get_impl_data(id).coerce_unsized_kind
+ pub fn get_coerce_unsized_info(&self,
+ id: DefIndex)
+ -> Option<ty::adjustment::CoerceUnsizedInfo> {
+ self.get_impl_data(id).coerce_unsized_info
}
pub fn get_impl_trait(&self,
}
}
+ #[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").
///