]> git.proxmox.com Git - rustc.git/blob - src/doc/book/redirects/type-aliases.md
New upstream version 1.25.0+dfsg1
[rustc.git] / src / doc / book / redirects / type-aliases.md
1 % `type` aliases
2
3 <small>There is a new edition of the book and this is an old link.</small>
4
5 > Rust provides the ability to declare a _type alias_ with the `type` keyword to give an existing type another name.
6
7 ```rust
8 type Kilometers = i32;
9 ```
10
11 ---
12
13 Here are the relevant sections in the new and old books:
14
15 * **[In the second edition: Ch 19.04 — Advanced Types, section Type Synonyms][2]**
16 * <small>[In the first edition: Ch 3.28 — `type` aliases][1]</small>
17
18
19 [1]: first-edition/type-aliases.html
20 [2]: second-edition/ch19-04-advanced-types.html#type-aliases-create-type-synonyms
21