]> git.proxmox.com Git - rustc.git/blob - src/doc/book/redirects/primitive-types.md
New upstream version 1.25.0+dfsg1
[rustc.git] / src / doc / book / redirects / primitive-types.md
1 % Primitive Types
2
3 <small>There is a new edition of the book and this is an old link.</small>
4
5 > Rust is a _statically typed_ language, which means that it must know the types of all variables at compile time.
6 > The compiler can usually infer what type we want to use based on the value and how we use it.
7 > In cases when many types are possible, a _type annotation_ must be added.
8
9 ```rust
10 let x = 2.0; // f64
11
12 let y: f32 = 3.0; // f32
13 ```
14
15 ---
16
17 Here are the relevant sections in the new and old books:
18
19 * **[In the second edition: Ch 3.02 — Data Types][2]**
20 * <small>[In the first edition: Ch 3.3 — Primitive Types][1]</small>
21
22
23 [1]: first-edition/primitive-types.html
24 [2]: second-edition/ch03-02-data-types.html