@@ -2056,11 +2056,10 @@ method declarations. So, re-declaring the type parameter
2056
2056
` T ` as an explicit type parameter for ` len ` , in either the trait or
2057
2057
the impl, would be a compile-time error.
2058
2058
2059
- Within a trait definition, ` self ` is a special type that you can think
2059
+ Within a trait definition, ` Self ` is a special type that you can think
2060
2060
of as a type parameter. An implementation of the trait for any given
2061
- type ` T ` replaces the ` self ` type parameter with ` T ` . Simply, in a
2062
- trait, ` self ` is a type, and in an impl, ` self ` is a value. The
2063
- following trait describes types that support an equality operation:
2061
+ type ` T ` replaces the ` Self ` type parameter with ` T ` . The following
2062
+ trait describes types that support an equality operation:
2064
2063
2065
2064
~~~~
2066
2065
// In a trait, `self` refers to the self argument.
@@ -2076,7 +2075,7 @@ impl Eq for int {
2076
2075
~~~~
2077
2076
2078
2077
Notice that in the trait definition, ` equals ` takes a
2079
- second parameter of type ` self ` .
2078
+ second parameter of type ` Self ` .
2080
2079
In contrast, in the ` impl ` , ` equals ` takes a second parameter of
2081
2080
type ` int ` , only using ` self ` as the name of the receiver.
2082
2081
0 commit comments