diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2015-10-26 12:31:17 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2015-10-26 12:31:17 +0300 |
| commit | 32e4ba8f50de279d2c3f0aaaf291e650e067fff7 (patch) | |
| tree | fc89a1ee97b09ef18c936420423333c9de9366ce | |
| parent | 72ed590f8b2210fccd26489d2237310cc2db2603 (diff) | |
| download | rust-32e4ba8f50de279d2c3f0aaaf291e650e067fff7.tar.gz rust-32e4ba8f50de279d2c3f0aaaf291e650e067fff7.zip | |
reference: clarify impl
Another kind of nominal types in Rust are trait objects, so the following is valid
```rust
trait A {
}
impl A {
}
```
| -rw-r--r-- | src/doc/reference.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index a9e12833906..037fb6a8d98 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -1520,11 +1520,11 @@ impl Shape for Circle { ``` It is possible to define an implementation without referring to a trait. The -methods in such an implementation can only be used as direct calls on the -values of the type that the implementation targets. In such an implementation, -the trait type and `for` after `impl` are omitted. Such implementations are -limited to nominal types (enums, structs), and the implementation must appear -in the same crate as the `self` type: +methods in such an implementation can only be used as direct calls on the values +of the type that the implementation targets. In such an implementation, the +trait type and `for` after `impl` are omitted. Such implementations are limited +to nominal types (enums, structs, trait objects), and the implementation must +appear in the same crate as the `self` type: ``` struct Point {x: i32, y: i32} |
