File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -109,13 +109,15 @@ following types:
109109- [ ` Arc<Self> ` ]
110110- [ ` Pin<P> ` ] where ` P ` is one of the above types except ` Self ` .
111111
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.
113114
114115``` rust
115116# use std :: rc :: Rc ;
116117# use std :: sync :: Arc ;
117118# use std :: pin :: Pin ;
118119struct Example ;
120+ type Alias = Example ;
119121impl Example {
120122 fn by_value (self : Self ) {}
121123 fn by_ref (self : & Self ) {}
@@ -126,6 +128,7 @@ impl Example {
126128 fn by_pin (self : Pin <& Self >) {}
127129 fn explicit_type (self : Arc <Example >) {}
128130 fn with_lifetime <'a >(self : & 'a Self ) {}
131+ fn nested <'a >(self : & mut & 'a Arc <Rc <Box <Alias >>>) {}
129132}
130133```
131134
@@ -360,4 +363,4 @@ fn main() {
360363[ function item ] : ../types/function-item.md
361364[ method call operator ] : ../expressions/method-call-expr.md
362365[ 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