@@ -8,11 +8,12 @@ use rustc_macros::{HashStable_NoContext, TyDecodable, TyEncodable};
88use rustc_serialize:: Decodable ;
99use tracing:: debug;
1010
11+ use crate :: debug:: { DebugWithInfcx , WithInfcx } ;
1112use crate :: fold:: { FallibleTypeFolder , TypeFoldable , TypeFolder , TypeSuperFoldable } ;
1213use crate :: inherent:: * ;
1314use crate :: lift:: Lift ;
1415use crate :: visit:: { Flags , TypeSuperVisitable , TypeVisitable , TypeVisitableExt , TypeVisitor } ;
15- use crate :: { self as ty, Interner , SsoHashSet } ;
16+ use crate :: { self as ty, InferCtxtLike , Interner , SsoHashSet } ;
1617
1718/// Binder is a binder for higher-ranked lifetimes or types. It is part of the
1819/// compiler's representation for things like `for<'a> Fn(&'a isize)`
5556 }
5657}
5758
59+ impl < I : Interner , T : DebugWithInfcx < I > > DebugWithInfcx < I > for ty:: Binder < I , T > {
60+ fn fmt < Infcx : InferCtxtLike < Interner = I > > (
61+ this : WithInfcx < ' _ , Infcx , & Self > ,
62+ f : & mut core:: fmt:: Formatter < ' _ > ,
63+ ) -> core:: fmt:: Result {
64+ f. debug_tuple ( "Binder" )
65+ . field ( & this. map ( |data| data. as_ref ( ) . skip_binder ( ) ) )
66+ . field ( & this. data . bound_vars ( ) )
67+ . finish ( )
68+ }
69+ }
70+
5871macro_rules! impl_binder_encode_decode {
5972 ( $( $t: ty) ,+ $( , ) ?) => {
6073 $(
0 commit comments