File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -109,13 +109,15 @@ following types:
109
109
- [ ` Arc<Self> ` ]
110
110
- [ ` Pin<P> ` ] where ` P ` is one of the above types except ` Self ` .
111
111
112
- The ` Self ` term can be replaced with the type being implemented.
112
+ The ` Self ` term can be replaced with the type being implemented, including
113
+ type aliases for the type, or any nested combination of the above types.
113
114
114
115
``` rust
115
116
# use std :: rc :: Rc ;
116
117
# use std :: sync :: Arc ;
117
118
# use std :: pin :: Pin ;
118
119
struct Example ;
120
+ type Alias = Example ;
119
121
impl Example {
120
122
fn by_value (self : Self ) {}
121
123
fn by_ref (self : & Self ) {}
@@ -126,6 +128,7 @@ impl Example {
126
128
fn by_pin (self : Pin <& Self >) {}
127
129
fn explicit_type (self : Arc <Example >) {}
128
130
fn with_lifetime <'a >(self : & 'a Self ) {}
131
+ fn nested <'a >(self : & mut & 'a Arc <Rc <Box <Alias >>>) {}
129
132
}
130
133
```
131
134
@@ -360,4 +363,4 @@ fn main() {
360
363
[ function item ] : ../types/function-item.md
361
364
[ method call operator ] : ../expressions/method-call-expr.md
362
365
[ path ] : ../paths.md
363
- [ regular function parameters] : functions.md#attributes-on-function-parameters
366
+ [ regular function parameters ] : functions.md#attributes-on-function-parameters
You can’t perform that action at this time.
0 commit comments