Skip to content

Commit 986f523

Browse files
committed
Take method invocation semantics out of chapter on deref coercion.
1 parent 0762f58 commit 986f523

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/doc/trpl/deref-coercions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ Vectors can `Deref` to a slice.
8989

9090
## Deref and method calls
9191

92-
`Deref` will also kick in when calling a method. In other words, these are
93-
the same two things in Rust:
92+
`Deref` will also kick in when calling a method. Consider the following
93+
example.
9494

9595
```rust
9696
struct Foo;
@@ -99,13 +99,13 @@ impl Foo {
9999
fn foo(&self) { println!("Foo"); }
100100
}
101101

102-
let f = Foo;
102+
let f = &&Foo;
103103

104104
f.foo();
105105
```
106106

107-
Even though `f` isn’t a reference, and `foo` takes `&self`, this works.
108-
That’s because these things are the same:
107+
Even though `f` is a `&&Foo` and `foo` takes `&self`, this works. That’s
108+
because these things are the same:
109109

110110
```rust,ignore
111111
f.foo();

0 commit comments

Comments
 (0)