Skip to content

Commit 68e4157

Browse files
committed
Update for nested receivers.
1 parent faac114 commit 68e4157

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/items/associated-items.md

+5-2
Original file line numberDiff line numberDiff 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;
118119
struct Example;
120+
type Alias = Example;
119121
impl 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

0 commit comments

Comments
 (0)