diff options
Diffstat (limited to 'src/doc/book/redirects/primitive-types.md')
-rw-r--r-- | src/doc/book/redirects/primitive-types.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/doc/book/redirects/primitive-types.md b/src/doc/book/redirects/primitive-types.md new file mode 100644 index 000000000..aff51f782 --- /dev/null +++ b/src/doc/book/redirects/primitive-types.md @@ -0,0 +1,24 @@ +% Primitive Types + +<small>There is a new edition of the book and this is an old link.</small> + +> Rust is a _statically typed_ language, which means that it must know the types of all variables at compile time. +> The compiler can usually infer what type we want to use based on the value and how we use it. +> In cases when many types are possible, a _type annotation_ must be added. + +```rust +let x = 2.0; // f64 + +let y: f32 = 3.0; // f32 +``` + +--- + +Here are the relevant sections in the new and old books: + +* **[in the current edition: Ch 3.02 — Data Types][2]** +* <small>[In the first edition: Ch 3.3 — Primitive Types][1]</small> + + +[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/primitive-types.html +[2]: ch03-02-data-types.html |