@@ -45,8 +45,11 @@ use crate::util::nodemap::FxHashSet;
45
45
/// To implement this conveniently, use the
46
46
/// `BraceStructTypeFoldableImpl` etc macros found in `macros.rs`.
47
47
pub trait TypeFoldable < ' tcx > : fmt:: Debug + Clone {
48
- fn super_fold_with < ' gcx : ' tcx , F : TypeFolder < ' gcx , ' tcx > > ( & self , folder : & mut F ) -> Result < Self , F :: Error > ;
49
- fn fold_with < ' gcx : ' tcx , F : TypeFolder < ' gcx , ' tcx > > ( & self , folder : & mut F ) -> Result < Self , F :: Error > {
48
+ fn super_fold_with < ' gcx : ' tcx , F : TypeFolder < ' gcx , ' tcx > >
49
+ ( & self , folder : & mut F ) -> Result < Self , F :: Error > ;
50
+ fn fold_with < ' gcx : ' tcx , F : TypeFolder < ' gcx , ' tcx > >
51
+ ( & self , folder : & mut F ) -> Result < Self , F :: Error >
52
+ {
50
53
self . super_fold_with ( folder)
51
54
}
52
55
@@ -188,7 +191,8 @@ pub trait TypeFolder<'gcx: 'tcx, 'tcx> : Sized {
188
191
}
189
192
190
193
#[ inline]
191
- fn fold_with_variance < T > ( & mut self , _variance : ty:: Variance , t : & T ) -> Result < T , Self :: Error >
194
+ fn fold_with_variance < T > ( & mut self , _variance : ty:: Variance , t : & T )
195
+ -> Result < T , Self :: Error >
192
196
where T : TypeFoldable < ' tcx >
193
197
{
194
198
t. fold_with ( self )
@@ -202,7 +206,9 @@ pub trait TypeFolder<'gcx: 'tcx, 'tcx> : Sized {
202
206
r. super_fold_with ( self )
203
207
}
204
208
205
- fn fold_const ( & mut self , c : & ' tcx ty:: LazyConst < ' tcx > ) -> Result < & ' tcx ty:: LazyConst < ' tcx > , Self :: Error > {
209
+ fn fold_const ( & mut self , c : & ' tcx ty:: LazyConst < ' tcx > )
210
+ -> Result < & ' tcx ty:: LazyConst < ' tcx > , Self :: Error >
211
+ {
206
212
c. super_fold_with ( self )
207
213
}
208
214
}
@@ -432,7 +438,9 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for RegionFolder<'a, 'gcx, 'tcx> {
432
438
433
439
fn tcx < ' b > ( & ' b self ) -> TyCtxt < ' b , ' gcx , ' tcx > { self . tcx }
434
440
435
- fn fold_binder < T : TypeFoldable < ' tcx > > ( & mut self , t : & ty:: Binder < T > ) -> Result < ty:: Binder < T > , !> {
441
+ fn fold_binder < T : TypeFoldable < ' tcx > > ( & mut self , t : & ty:: Binder < T > )
442
+ -> Result < ty:: Binder < T > , !>
443
+ {
436
444
self . current_index . shift_in ( 1 ) ;
437
445
let t = t. super_fold_with ( self ) ;
438
446
self . current_index . shift_out ( 1 ) ;
@@ -494,7 +502,9 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for BoundVarReplacer<'a, 'gcx, 'tcx>
494
502
495
503
fn tcx < ' b > ( & ' b self ) -> TyCtxt < ' b , ' gcx , ' tcx > { self . tcx }
496
504
497
- fn fold_binder < T : TypeFoldable < ' tcx > > ( & mut self , t : & ty:: Binder < T > ) -> Result < ty:: Binder < T > , !> {
505
+ fn fold_binder < T : TypeFoldable < ' tcx > > ( & mut self , t : & ty:: Binder < T > )
506
+ -> Result < ty:: Binder < T > , !>
507
+ {
498
508
self . current_index . shift_in ( 1 ) ;
499
509
let t = t. super_fold_with ( self ) ;
500
510
self . current_index . shift_out ( 1 ) ;
@@ -732,7 +742,9 @@ impl TypeFolder<'gcx, 'tcx> for Shifter<'a, 'gcx, 'tcx> {
732
742
733
743
fn tcx < ' b > ( & ' b self ) -> TyCtxt < ' b , ' gcx , ' tcx > { self . tcx }
734
744
735
- fn fold_binder < T : TypeFoldable < ' tcx > > ( & mut self , t : & ty:: Binder < T > ) -> Result < ty:: Binder < T > , !> {
745
+ fn fold_binder < T : TypeFoldable < ' tcx > > ( & mut self , t : & ty:: Binder < T > )
746
+ -> Result < ty:: Binder < T > , !>
747
+ {
736
748
self . current_index . shift_in ( 1 ) ;
737
749
let t = t. super_fold_with ( self ) ;
738
750
self . current_index . shift_out ( 1 ) ;
0 commit comments