Skip to content

Commit c5ef18c

Browse files
authored
Merge pull request rust-lang#163 from brauliobz/grammar_type_alias
Type alias grammar
2 parents ca1d926 + 3081712 commit c5ef18c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/items/type-aliases.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Type aliases
22

3+
> **<sup>Syntax</sup>**
4+
> _TypeAlias_ :
5+
> &nbsp;&nbsp; `type` [IDENTIFIER]&nbsp;[_Generics_]<sup>?</sup>
6+
> [_WhereClause_]<sup>?</sup> `=` [_Type_] `;`
7+
38
A _type alias_ defines a new name for an existing [type]. Type aliases are
49
declared with the keyword `type`. Every value has a single, specific type, but
510
may implement several different traits, or be compatible with several different
@@ -23,3 +28,8 @@ type F = E;
2328
let _: F = E::A; // OK
2429
// let _: F = F::A; // Doesn't work
2530
```
31+
32+
[IDENTIFIER]: identifiers.html
33+
[_Generics_]: items.html#type-parameters
34+
[_WhereClause_]: items.html#type-parameters
35+
[_Type_]: types.html

0 commit comments

Comments
 (0)