@@ -45,8 +45,11 @@ use crate::util::nodemap::FxHashSet;
4545/// To implement this conveniently, use the
4646/// `BraceStructTypeFoldableImpl` etc macros found in `macros.rs`.
4747pub 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+ {
5053 self . super_fold_with ( folder)
5154 }
5255
@@ -188,7 +191,8 @@ pub trait TypeFolder<'gcx: 'tcx, 'tcx> : Sized {
188191 }
189192
190193 #[ 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 >
192196 where T : TypeFoldable < ' tcx >
193197 {
194198 t. fold_with ( self )
@@ -202,7 +206,9 @@ pub trait TypeFolder<'gcx: 'tcx, 'tcx> : Sized {
202206 r. super_fold_with ( self )
203207 }
204208
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+ {
206212 c. super_fold_with ( self )
207213 }
208214}
@@ -432,7 +438,9 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for RegionFolder<'a, 'gcx, 'tcx> {
432438
433439 fn tcx < ' b > ( & ' b self ) -> TyCtxt < ' b , ' gcx , ' tcx > { self . tcx }
434440
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+ {
436444 self . current_index . shift_in ( 1 ) ;
437445 let t = t. super_fold_with ( self ) ;
438446 self . current_index . shift_out ( 1 ) ;
@@ -494,7 +502,9 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for BoundVarReplacer<'a, 'gcx, 'tcx>
494502
495503 fn tcx < ' b > ( & ' b self ) -> TyCtxt < ' b , ' gcx , ' tcx > { self . tcx }
496504
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+ {
498508 self . current_index . shift_in ( 1 ) ;
499509 let t = t. super_fold_with ( self ) ;
500510 self . current_index . shift_out ( 1 ) ;
@@ -732,7 +742,9 @@ impl TypeFolder<'gcx, 'tcx> for Shifter<'a, 'gcx, 'tcx> {
732742
733743 fn tcx < ' b > ( & ' b self ) -> TyCtxt < ' b , ' gcx , ' tcx > { self . tcx }
734744
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+ {
736748 self . current_index . shift_in ( 1 ) ;
737749 let t = t. super_fold_with ( self ) ;
738750 self . current_index . shift_out ( 1 ) ;
0 commit comments