@@ -136,31 +136,21 @@ pub trait TypeFolder<I: Interner>: FallibleTypeFolder<I, Error = Never> {
136136 t. super_fold_with ( self )
137137 }
138138
139- fn fold_ty ( & mut self , t : I :: Ty ) -> I :: Ty
140- where
141- I :: Ty : TypeSuperFoldable < I > ,
142- {
139+ fn fold_ty ( & mut self , t : I :: Ty ) -> I :: Ty {
143140 t. super_fold_with ( self )
144141 }
145142
146143 // The default region folder is a no-op because `Region` is non-recursive
147- // and has no `super_fold_with` method to call. That also explains the
148- // lack of `I::Region: TypeSuperFoldable<I>` bound on this method.
144+ // and has no `super_fold_with` method to call.
149145 fn fold_region ( & mut self , r : I :: Region ) -> I :: Region {
150146 r
151147 }
152148
153- fn fold_const ( & mut self , c : I :: Const ) -> I :: Const
154- where
155- I :: Const : TypeSuperFoldable < I > ,
156- {
149+ fn fold_const ( & mut self , c : I :: Const ) -> I :: Const {
157150 c. super_fold_with ( self )
158151 }
159152
160- fn fold_predicate ( & mut self , p : I :: Predicate ) -> I :: Predicate
161- where
162- I :: Predicate : TypeSuperFoldable < I > ,
163- {
153+ fn fold_predicate ( & mut self , p : I :: Predicate ) -> I :: Predicate {
164154 p. super_fold_with ( self )
165155 }
166156}
@@ -185,31 +175,21 @@ pub trait FallibleTypeFolder<I: Interner>: Sized {
185175 t. try_super_fold_with ( self )
186176 }
187177
188- fn try_fold_ty ( & mut self , t : I :: Ty ) -> Result < I :: Ty , Self :: Error >
189- where
190- I :: Ty : TypeSuperFoldable < I > ,
191- {
178+ fn try_fold_ty ( & mut self , t : I :: Ty ) -> Result < I :: Ty , Self :: Error > {
192179 t. try_super_fold_with ( self )
193180 }
194181
195182 // The default region folder is a no-op because `Region` is non-recursive
196- // and has no `super_fold_with` method to call. That also explains the
197- // lack of `I::Region: TypeSuperFoldable<I>` bound on this method.
183+ // and has no `super_fold_with` method to call.
198184 fn try_fold_region ( & mut self , r : I :: Region ) -> Result < I :: Region , Self :: Error > {
199185 Ok ( r)
200186 }
201187
202- fn try_fold_const ( & mut self , c : I :: Const ) -> Result < I :: Const , Self :: Error >
203- where
204- I :: Const : TypeSuperFoldable < I > ,
205- {
188+ fn try_fold_const ( & mut self , c : I :: Const ) -> Result < I :: Const , Self :: Error > {
206189 c. try_super_fold_with ( self )
207190 }
208191
209- fn try_fold_predicate ( & mut self , p : I :: Predicate ) -> Result < I :: Predicate , Self :: Error >
210- where
211- I :: Predicate : TypeSuperFoldable < I > ,
212- {
192+ fn try_fold_predicate ( & mut self , p : I :: Predicate ) -> Result < I :: Predicate , Self :: Error > {
213193 p. try_super_fold_with ( self )
214194 }
215195}
@@ -234,28 +214,19 @@ where
234214 Ok ( self . fold_binder ( t) )
235215 }
236216
237- fn try_fold_ty ( & mut self , t : I :: Ty ) -> Result < I :: Ty , Never >
238- where
239- I :: Ty : TypeSuperFoldable < I > ,
240- {
217+ fn try_fold_ty ( & mut self , t : I :: Ty ) -> Result < I :: Ty , Never > {
241218 Ok ( self . fold_ty ( t) )
242219 }
243220
244221 fn try_fold_region ( & mut self , r : I :: Region ) -> Result < I :: Region , Never > {
245222 Ok ( self . fold_region ( r) )
246223 }
247224
248- fn try_fold_const ( & mut self , c : I :: Const ) -> Result < I :: Const , Never >
249- where
250- I :: Const : TypeSuperFoldable < I > ,
251- {
225+ fn try_fold_const ( & mut self , c : I :: Const ) -> Result < I :: Const , Never > {
252226 Ok ( self . fold_const ( c) )
253227 }
254228
255- fn try_fold_predicate ( & mut self , p : I :: Predicate ) -> Result < I :: Predicate , Never >
256- where
257- I :: Predicate : TypeSuperFoldable < I > ,
258- {
229+ fn try_fold_predicate ( & mut self , p : I :: Predicate ) -> Result < I :: Predicate , Never > {
259230 Ok ( self . fold_predicate ( p) )
260231 }
261232}
0 commit comments