@@ -62,28 +62,28 @@ impl<I: Interner> InferenceTable<I> {
6262 }
6363
6464 /// Variant on `instantiate_in` that takes a `Binders<T>`.
65- pub ( crate ) fn instantiate_binders_existentially < T > (
65+ pub ( crate ) fn instantiate_binders_existentially < ' a , T > (
6666 & mut self ,
67- interner : & I ,
68- arg : impl IntoBindersAndValue < Value = T > ,
67+ interner : & ' a I ,
68+ arg : impl IntoBindersAndValue < ' a , I , Value = T > ,
6969 ) -> T :: Result
7070 where
7171 T : Fold < I > ,
7272 {
73- let ( binders, value) = arg. into_binders_and_value ( ) ;
73+ let ( binders, value) = arg. into_binders_and_value ( interner ) ;
7474 let max_universe = self . max_universe ;
7575 self . instantiate_in ( interner, max_universe, binders, & value)
7676 }
7777
78- pub ( crate ) fn instantiate_binders_universally < T > (
78+ pub ( crate ) fn instantiate_binders_universally < ' a , T > (
7979 & mut self ,
80- interner : & I ,
81- arg : impl IntoBindersAndValue < Value = T > ,
80+ interner : & ' a I ,
81+ arg : impl IntoBindersAndValue < ' a , I , Value = T > ,
8282 ) -> T :: Result
8383 where
8484 T : Fold < I > ,
8585 {
86- let ( binders, value) = arg. into_binders_and_value ( ) ;
86+ let ( binders, value) = arg. into_binders_and_value ( interner ) ;
8787 let ui = self . new_universe ( ) ;
8888 let parameters: Vec < _ > = binders
8989 . into_iter ( )
@@ -103,34 +103,34 @@ impl<I: Interner> InferenceTable<I> {
103103 }
104104}
105105
106- pub ( crate ) trait IntoBindersAndValue {
106+ pub ( crate ) trait IntoBindersAndValue < ' a , I : Interner > {
107107 type Binders : IntoIterator < Item = ParameterKind < ( ) > > ;
108108 type Value ;
109109
110- fn into_binders_and_value ( self ) -> ( Self :: Binders , Self :: Value ) ;
110+ fn into_binders_and_value ( self , interner : & ' a I ) -> ( Self :: Binders , Self :: Value ) ;
111111}
112112
113- impl < ' a , I , T > IntoBindersAndValue for ( & ' a Binders < T > , & ' a I )
113+ impl < ' a , I , T > IntoBindersAndValue < ' a , I > for & ' a Binders < T >
114114where
115115 I : Interner ,
116116 T : HasInterner < Interner = I > ,
117117{
118118 type Binders = std:: iter:: Cloned < std:: slice:: Iter < ' a , ParameterKind < ( ) > > > ;
119119 type Value = & ' a T ;
120120
121- fn into_binders_and_value ( self ) -> ( Self :: Binders , Self :: Value ) {
122- ( self . 0 . binders . iter ( self . 1 ) . cloned ( ) , self . 0 . skip_binders ( ) )
121+ fn into_binders_and_value ( self , interner : & ' a I ) -> ( Self :: Binders , Self :: Value ) {
122+ ( self . binders . iter ( interner ) . cloned ( ) , self . skip_binders ( ) )
123123 }
124124}
125125
126- impl < ' a , I > IntoBindersAndValue for & ' a Fn < I >
126+ impl < ' a , I > IntoBindersAndValue < ' a , I > for & ' a Fn < I >
127127where
128128 I : Interner ,
129129{
130130 type Binders = std:: iter:: Map < std:: ops:: Range < usize > , fn ( usize ) -> chalk_ir:: ParameterKind < ( ) > > ;
131131 type Value = & ' a Substitution < I > ;
132132
133- fn into_binders_and_value ( self ) -> ( Self :: Binders , Self :: Value ) {
133+ fn into_binders_and_value ( self , _interner : & ' a I ) -> ( Self :: Binders , Self :: Value ) {
134134 fn make_lifetime ( _: usize ) -> ParameterKind < ( ) > {
135135 ParameterKind :: Lifetime ( ( ) )
136136 }
@@ -140,11 +140,11 @@ where
140140 }
141141}
142142
143- impl < ' a , T > IntoBindersAndValue for ( & ' a Vec < ParameterKind < ( ) > > , & ' a T ) {
143+ impl < ' a , T , I : Interner > IntoBindersAndValue < ' a , I > for ( & ' a Vec < ParameterKind < ( ) > > , & ' a T ) {
144144 type Binders = std:: iter:: Cloned < std:: slice:: Iter < ' a , ParameterKind < ( ) > > > ;
145145 type Value = & ' a T ;
146146
147- fn into_binders_and_value ( self ) -> ( Self :: Binders , Self :: Value ) {
147+ fn into_binders_and_value ( self , _interner : & ' a I ) -> ( Self :: Binders , Self :: Value ) {
148148 ( self . 0 . iter ( ) . cloned ( ) , & self . 1 )
149149 }
150150}
0 commit comments