@@ -136,31 +136,21 @@ pub trait TypeFolder<I: Interner>: FallibleTypeFolder<I, Error = Never> {
136
136
t. super_fold_with ( self )
137
137
}
138
138
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 {
143
140
t. super_fold_with ( self )
144
141
}
145
142
146
143
// 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.
149
145
fn fold_region ( & mut self , r : I :: Region ) -> I :: Region {
150
146
r
151
147
}
152
148
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 {
157
150
c. super_fold_with ( self )
158
151
}
159
152
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 {
164
154
p. super_fold_with ( self )
165
155
}
166
156
}
@@ -185,31 +175,21 @@ pub trait FallibleTypeFolder<I: Interner>: Sized {
185
175
t. try_super_fold_with ( self )
186
176
}
187
177
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 > {
192
179
t. try_super_fold_with ( self )
193
180
}
194
181
195
182
// 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.
198
184
fn try_fold_region ( & mut self , r : I :: Region ) -> Result < I :: Region , Self :: Error > {
199
185
Ok ( r)
200
186
}
201
187
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 > {
206
189
c. try_super_fold_with ( self )
207
190
}
208
191
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 > {
213
193
p. try_super_fold_with ( self )
214
194
}
215
195
}
@@ -234,28 +214,19 @@ where
234
214
Ok ( self . fold_binder ( t) )
235
215
}
236
216
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 > {
241
218
Ok ( self . fold_ty ( t) )
242
219
}
243
220
244
221
fn try_fold_region ( & mut self , r : I :: Region ) -> Result < I :: Region , Never > {
245
222
Ok ( self . fold_region ( r) )
246
223
}
247
224
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 > {
252
226
Ok ( self . fold_const ( c) )
253
227
}
254
228
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 > {
259
230
Ok ( self . fold_predicate ( p) )
260
231
}
261
232
}
0 commit comments