]> git.lizzy.rs Git - rust.git/commitdiff
Expanded entries for generics.
authorDaniel Keep <daniel.keep@gmail.com>
Fri, 9 Oct 2015 11:19:56 +0000 (22:19 +1100)
committerDaniel Keep <daniel.keep@gmail.com>
Fri, 9 Oct 2015 11:19:56 +0000 (22:19 +1100)
* Now mentions method generics.
* Has separate entries for generic `fn`, `struct`, `enum`, and `impl`
  items.

(Thanks killercup).

src/doc/trpl/syntax-index.md

index 099a576435136b9cd8acb65c5cd3a8ed0a96448c..7bbea8314f2f3c1e085e74f92331d16b94798fc0 100644 (file)
 
 <!-- Generics -->
 
-* `path<…>`: specifies parameters to generic type *in a type*.  See [Generics].
-* `path::<…>`: specifies parameters to generic type or function *in an expression*.
-* `ident<…>`: generic parameters.  See [Generics].
+* `path<…>` (*e.g.* `Vec<u8>`): specifies parameters to generic type *in a type*.  See [Generics].
+* `path::<…>`, `method::<…>` (*e.g.* `"42".parse::<i32>()`): specifies parameters to generic type, function, or method *in an expression*.
+* `fn ident<…> …`: define generic function.  See [Generics].
+* `struct ident<…> …`: define generic structure.  See [Generics].
+* `enum ident<…> …`: define generic enumeration.  See [Generics].
+* `impl<…> …`: define generic implementation.
 * `for<…> type`: higher-ranked lifetime bounds.
 * `type<ident=type>` (*e.g.* `Iterator<Item=T>`): a generic type where one or more associated types have specific assignments.  See [Associated Types].