Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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