@@ -34,7 +34,7 @@ use super::InferCtxt;
34
34
use rustc_data_structures:: fx:: FxHashMap ;
35
35
use rustc_middle:: infer:: unify_key:: ToType ;
36
36
use rustc_middle:: ty:: fold:: TypeFolder ;
37
- use rustc_middle:: ty:: { self , Ty , TyCtxt , TypeFoldable } ;
37
+ use rustc_middle:: ty:: { self , Ty , TyCtxt , TypeFoldable , TypeSuperFoldable } ;
38
38
use std:: collections:: hash_map:: Entry ;
39
39
40
40
pub struct TypeFreshener < ' a , ' tcx > {
@@ -228,12 +228,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
228
228
. probe_value ( v)
229
229
. val
230
230
. known ( ) ;
231
- return self . freshen_const (
232
- opt_ct,
233
- ty:: InferConst :: Var ( v) ,
234
- ty:: InferConst :: Fresh ,
235
- ct. ty ( ) ,
236
- ) ;
231
+ self . freshen_const ( opt_ct, ty:: InferConst :: Var ( v) , ty:: InferConst :: Fresh , ct. ty ( ) )
237
232
}
238
233
ty:: ConstKind :: Infer ( ty:: InferConst :: Fresh ( i) ) => {
239
234
if i >= self . const_freshen_count {
@@ -244,7 +239,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
244
239
self . const_freshen_count,
245
240
) ;
246
241
}
247
- return ct ;
242
+ ct
248
243
}
249
244
250
245
ty:: ConstKind :: Bound ( ..) | ty:: ConstKind :: Placeholder ( _) => {
@@ -254,9 +249,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
254
249
ty:: ConstKind :: Param ( _)
255
250
| ty:: ConstKind :: Value ( _)
256
251
| ty:: ConstKind :: Unevaluated ( ..)
257
- | ty:: ConstKind :: Error ( _) => { }
252
+ | ty:: ConstKind :: Error ( _) => ct . super_fold_with ( self ) ,
258
253
}
259
-
260
- ct. super_fold_with ( self )
261
254
}
262
255
}
0 commit comments