@@ -12,13 +12,13 @@ use super::ty::{
12
12
13
13
pub trait Folder : Sized {
14
14
type Break ;
15
- fn visit_ty ( & mut self , ty : & Ty ) -> ControlFlow < Self :: Break , Ty > {
15
+ fn fold_ty ( & mut self , ty : & Ty ) -> ControlFlow < Self :: Break , Ty > {
16
16
ty. super_fold ( self )
17
17
}
18
18
fn fold_const ( & mut self , c : & Const ) -> ControlFlow < Self :: Break , Const > {
19
19
c. super_fold ( self )
20
20
}
21
- fn visit_reg ( & mut self , reg : & Region ) -> ControlFlow < Self :: Break , Region > {
21
+ fn fold_reg ( & mut self , reg : & Region ) -> ControlFlow < Self :: Break , Region > {
22
22
reg. super_fold ( self )
23
23
}
24
24
}
@@ -32,7 +32,7 @@ pub trait Foldable: Sized + Clone {
32
32
33
33
impl Foldable for Ty {
34
34
fn fold < V : Folder > ( & self , folder : & mut V ) -> ControlFlow < V :: Break , Self > {
35
- folder. visit_ty ( self )
35
+ folder. fold_ty ( self )
36
36
}
37
37
fn super_fold < V : Folder > ( & self , folder : & mut V ) -> ControlFlow < V :: Break , Self > {
38
38
let mut kind = self . kind ( ) ;
@@ -114,7 +114,7 @@ impl Foldable for GenericArgs {
114
114
115
115
impl Foldable for Region {
116
116
fn fold < V : Folder > ( & self , folder : & mut V ) -> ControlFlow < V :: Break , Self > {
117
- folder. visit_reg ( self )
117
+ folder. fold_reg ( self )
118
118
}
119
119
fn super_fold < V : Folder > ( & self , folder : & mut V ) -> ControlFlow < V :: Break , Self > {
120
120
let mut kind = self . kind . clone ( ) ;
@@ -257,7 +257,7 @@ pub enum Never {}
257
257
impl Folder for GenericArgs {
258
258
type Break = Never ;
259
259
260
- fn visit_ty ( & mut self , ty : & Ty ) -> ControlFlow < Self :: Break , Ty > {
260
+ fn fold_ty ( & mut self , ty : & Ty ) -> ControlFlow < Self :: Break , Ty > {
261
261
ControlFlow :: Continue ( match ty. kind ( ) {
262
262
TyKind :: Param ( p) => self [ p] ,
263
263
_ => * ty,
0 commit comments