@@ -8,11 +8,12 @@ use rustc_macros::{HashStable_NoContext, TyDecodable, TyEncodable};
8
8
use rustc_serialize:: Decodable ;
9
9
use tracing:: debug;
10
10
11
+ use crate :: debug:: { DebugWithInfcx , WithInfcx } ;
11
12
use crate :: fold:: { FallibleTypeFolder , TypeFoldable , TypeFolder , TypeSuperFoldable } ;
12
13
use crate :: inherent:: * ;
13
14
use crate :: lift:: Lift ;
14
15
use crate :: visit:: { Flags , TypeSuperVisitable , TypeVisitable , TypeVisitableExt , TypeVisitor } ;
15
- use crate :: { self as ty, Interner , SsoHashSet } ;
16
+ use crate :: { self as ty, InferCtxtLike , Interner , SsoHashSet } ;
16
17
17
18
/// Binder is a binder for higher-ranked lifetimes or types. It is part of the
18
19
/// compiler's representation for things like `for<'a> Fn(&'a isize)`
55
56
}
56
57
}
57
58
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
+
58
71
macro_rules! impl_binder_encode_decode {
59
72
( $( $t: ty) ,+ $( , ) ?) => {
60
73
$(
0 commit comments