@@ -29,7 +29,7 @@ folder can substitute a new type in its place.
29
29
A common use for ` TypeFoldable ` is to permit a substitution -- that is,
30
30
replacing generic type parameters with their values.
31
31
32
- ## From TypeFoldable to Folder to SuperFold and back again
32
+ ## From TypeFoldable to Folder to TypeSuperFoldable and back again
33
33
34
34
The overall flow of folding is like this.
35
35
@@ -39,7 +39,7 @@ The overall flow of folding is like this.
39
39
callbacks in the [ ` Folder ` ] trait, invoking [ ` TypeFoldable::fold_with ` ] will in turn
40
40
invoke the corresponding method on the [ ` Folder ` ] trait, such as ` Folder::fold_ty ` .
41
41
3 . The default implementation of ` Folder::fold_ty ` , in turn, invokes
42
- ` SuperFold ::super_fold_with` . This will recursively fold the
42
+ ` TypeSuperFoldable ::super_fold_with` . This will recursively fold the
43
43
contents of the type. In some cases, the ` super_fold_with `
44
44
implementation invokes more specialized methods on [ ` Folder ` ] , such
45
45
as [ ` Folder::fold_free_var_ty ` ] , which makes it easier to write
@@ -53,7 +53,7 @@ Thus, as a user, you can customize folding by:
53
53
* Implementing the appropriate methods to "intercept" types/lifetimes/etc at the right level of
54
54
detail
55
55
* In those methods, if you find a case where you would prefer not to
56
- substitute a new value, then invoke ` SuperFold ::super_fold_with` to
56
+ substitute a new value, then invoke ` TypeSuperFoldable ::super_fold_with` to
57
57
return to the default behavior.
58
58
59
59
## The ` binders ` argument
@@ -77,21 +77,21 @@ type that will result from folding.
77
77
78
78
[ `Result` ] : https://rust-lang.github.io/chalk/chalk_ir/fold/trait.TypeFoldable.html#associatedtype.Result
79
79
80
- ## When to implement the TypeFoldable and SuperFold traits
80
+ ## When to implement the TypeFoldable and TypeSuperFoldable traits
81
81
82
82
Any piece of IR that represents a kind of "term" (e.g., a type, part
83
83
of a type, or a goal, etc) in the logic should implement ` TypeFoldable ` . We
84
84
also implement ` TypeFoldable ` for common collection types like ` Vec ` as well
85
85
as tuples, references, etc.
86
86
87
- The ` SuperFold ` trait should only be implemented for those types that
87
+ The ` TypeSuperFoldable ` trait should only be implemented for those types that
88
88
have a callback defined on the ` Folder ` trait (e.g., types and
89
89
lifetimes).
90
90
91
91
## Derives
92
92
93
93
Using the ` chalk-derive ` crate, you can auto-derive the ` TypeFoldable ` trait.
94
- There isn't presently a derive for ` SuperFold ` since it is very rare
94
+ There isn't presently a derive for ` TypeSuperFoldable ` since it is very rare
95
95
to require it. The derive for ` TypeFoldable ` is a bit cludgy and requires:
96
96
97
97
* You must import ` TypeFoldable ` into scope.
0 commit comments