commit
7bb0d0d74c
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user