Skip to content

Commit 45b6d2f

Browse files
committed
Changes suggested by Rantanen on IRC
1 parent 12dc093 commit 45b6d2f

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/items/implementations.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Implementations
22

3-
An _implementation_ is an item that associates items with a *implementing type*.
3+
An _implementation_ is an item that associates items with an *implementing type*.
44

55
There are two types of implementations: Bare implementations and [trait]
66
implementations.
@@ -11,16 +11,22 @@ Implementations are defined with the keyword `impl`.
1111

1212
A bare implementation is defined as the keyword `impl` optionally followed by
1313
generic type declarations followed by a [nominal] type optionally followed by
14-
where clauses followed by a container of braces of a set of zero or more
15-
associable items.
14+
where clauses followed by a set of zero or more associable items contained
15+
within braces.
16+
17+
sequence of 'impl' keyword, generic type declarations, nominal type, where clause and the associable items. Generic type declarations and where clause can be omitted, if not needed. The associable items are contained within braces.
18+
19+
A bare implementation is defined as the sequence of the `impl` keyword, generic
20+
type declarations, a path to a nomial tyupe, a where clause, and a bracketed
21+
set of associable items.
1622

1723
The nominal type is called the *implementing type* and the associable items are
1824
the *associated items* to the implementing type.
1925

2026
Bare implementations associates the associated items to the implementing type.
2127

22-
The associated item has a canonical path of the canonical path of the
23-
implementing type followed by the associate item's path component.
28+
The associated item has a path of a path to the implementing type followed by
29+
the associate item's path component.
2430

2531
A type can have multiple bare implementations.
2632

@@ -54,10 +60,9 @@ A trait implementation must define all non-default associated items declared
5460
by the implemented trait, may redefine default associated items defined by the
5561
implemented trait trait, and cannot define any other items.
5662

57-
The canonical path to the associated items is `<` followed by the canonical path
58-
of the implementing type followed by `as` followed by the canonical path to the
59-
trait followed by `>` as a path component followed by the associated item's path
60-
component.
63+
The path to the associated items is `<` followed by a path to the implementing
64+
type followed by `as` followed by a path to the trait followed by `>` as a path
65+
component followed by the associated item's path component.
6166

6267
```rust
6368
# #[derive(Copy, Clone)]
@@ -110,7 +115,7 @@ the following conditions:
110115
meet the following grammar, where `C` is a nominal type defined
111116
within the containing crate:
112117

113-
```
118+
```ignore
114119
T = C
115120
| [T]
116121
| [T, ..n]

0 commit comments

Comments
 (0)