Skip to content

Commit

Permalink
Auto merge of #28102 - arielb1:fix-log-again, r=eddyb
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Aug 30, 2015
2 parents 9a82594 + ec6c3db commit 7bb0d0d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/librustc/ast_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
29 changes: 27 additions & 2 deletions src/librustc/util/ppaux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7bb0d0d

Please sign in to comment.