@@ -307,8 +307,20 @@ impl<'tcx> fmt::Display for ty::TraitTy<'tcx> {
307307
308308impl < ' tcx > fmt:: Debug for ty:: TypeParameterDef < ' tcx > {
309309 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
310- write ! ( f, "TypeParameterDef({:?}, {:?}/{})" ,
311- self . def_id, self . space, self . index)
310+ write ! ( f, "TypeParameterDef({}, {}:{}, {:?}/{})" ,
311+ self . name,
312+ self . def_id. krate, self . def_id. node,
313+ self . space, self . index)
314+ }
315+ }
316+
317+ impl fmt:: Debug for ty:: RegionParameterDef {
318+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
319+ write ! ( f, "RegionParameterDef({}, {}:{}, {:?}/{}, {:?})" ,
320+ self . name,
321+ self . def_id. krate, self . def_id. node,
322+ self . space, self . index,
323+ self . bounds)
312324 }
313325}
314326
@@ -388,6 +400,19 @@ impl fmt::Display for ty::BoundRegion {
388400 }
389401}
390402
403+ impl fmt:: Debug for ty:: BoundRegion {
404+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
405+ match * self {
406+ BrAnon ( n) => write ! ( f, "BrAnon({:?})" , n) ,
407+ BrFresh ( n) => write ! ( f, "BrFresh({:?})" , n) ,
408+ BrNamed ( did, name) => {
409+ write ! ( f, "BrNamed({}:{}, {:?})" , did. krate, did. node, name)
410+ }
411+ BrEnv => "BrEnv" . fmt ( f) ,
412+ }
413+ }
414+ }
415+
391416impl fmt:: Debug for ty:: Region {
392417 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
393418 match * self {
0 commit comments