Skip to content

Commit b78614f

Browse files
committed
Expanded entries for generics.
* Now mentions method generics. * Has separate entries for generic `fn`, `struct`, `enum`, and `impl` items. (Thanks killercup).
1 parent 702b6e5 commit b78614f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/doc/trpl/syntax-index.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,12 @@
116116

117117
<!-- Generics -->
118118

119-
* `path<…>`: specifies parameters to generic type *in a type*. See [Generics].
120-
* `path::<…>`: specifies parameters to generic type or function *in an expression*.
121-
* `ident<…>`: generic parameters. See [Generics].
119+
* `path<…>` (*e.g.* `Vec<u8>`): specifies parameters to generic type *in a type*. See [Generics].
120+
* `path::<…>`, `method::<…>` (*e.g.* `"42".parse::<i32>()`): specifies parameters to generic type, function, or method *in an expression*.
121+
* `fn ident<…> …`: define generic function. See [Generics].
122+
* `struct ident<…> …`: define generic structure. See [Generics].
123+
* `enum ident<…> …`: define generic enumeration. See [Generics].
124+
* `impl<…> …`: define generic implementation.
122125
* `for<…> type`: higher-ranked lifetime bounds.
123126
* `type<ident=type>` (*e.g.* `Iterator<Item=T>`): a generic type where one or more associated types have specific assignments. See [Associated Types].
124127

0 commit comments

Comments
 (0)