fix compilation with RUST_LOG=rustc::middle::traits

This commit is contained in:
Ariel Ben-Yehuda 2015-08-30 19:07:44 +03:00
parent 4bb90232da
commit ec6c3dbae5
3 changed files with 30 additions and 4 deletions

View File

@ -480,6 +480,7 @@ impl<'ast> Map<'ast> {
NodeImplItem(ii) => PathName(ii.ident.name),
NodeTraitItem(ti) => PathName(ti.ident.name),
NodeVariant(v) => PathName(v.node.name.name),
NodeLifetime(lt) => PathName(lt.name),
_ => panic!("no path elem for {:?}", node)
}
}

View File

@ -1733,7 +1733,7 @@ pub struct FreeRegion {
}
#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash,
RustcEncodable, RustcDecodable, Copy, Debug)]
RustcEncodable, RustcDecodable, Copy)]
pub enum BoundRegion {
/// An anonymous region parameter for a given fn (&T)
BrAnon(u32),
@ -2325,7 +2325,7 @@ pub struct TypeParameterDef<'tcx> {
pub object_lifetime_default: ObjectLifetimeDefault,
}
#[derive(Clone, Debug)]
#[derive(Clone)]
pub struct RegionParameterDef {
pub name: ast::Name,
pub def_id: DefId,

View File

@ -307,8 +307,20 @@ impl<'tcx> fmt::Display for ty::TraitTy<'tcx> {
impl<'tcx> fmt::Debug for ty::TypeParameterDef<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TypeParameterDef({:?}, {:?}/{})",
self.def_id, self.space, self.index)
write!(f, "TypeParameterDef({}, {}:{}, {:?}/{})",
self.name,
self.def_id.krate, self.def_id.node,
self.space, self.index)
}
}
impl fmt::Debug for ty::RegionParameterDef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RegionParameterDef({}, {}:{}, {:?}/{}, {:?})",
self.name,
self.def_id.krate, self.def_id.node,
self.space, self.index,
self.bounds)
}
}
@ -388,6 +400,19 @@ impl fmt::Display for ty::BoundRegion {
}
}
impl fmt::Debug for ty::BoundRegion {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
BrAnon(n) => write!(f, "BrAnon({:?})", n),
BrFresh(n) => write!(f, "BrFresh({:?})", n),
BrNamed(did, name) => {
write!(f, "BrNamed({}:{}, {:?})", did.krate, did.node, name)
}
BrEnv => "BrEnv".fmt(f),
}
}
}
impl fmt::Debug for ty::Region {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {