Skip to content

Commit adea99c

Browse files
committed
Rollup merge of rust-lang#22378 - jxcl:master, r=steveklabnik
The Rust Programming Language book has no explanation of what `i32` actually means. I have added an explanation for the first time the reader encounters this type.
2 parents 47814a4 + 74ba529 commit adea99c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/doc/trpl/variable-bindings.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ let x: i32 = 5;
4040
If I asked you to read this out loud to the rest of the class, you'd say "`x`
4141
is a binding with the type `i32` and the value `five`."
4242

43+
In this case we chose to represent `x` as a 32-bit signed integer. Rust has
44+
many different primitive integer types. They begin with `i` for signed integers
45+
and `u` for unsigned integers. The possible integer sizes are 8, 16, 32, and 64
46+
bits.
47+
4348
In future examples, we may annotate the type in a comment. The examples will
4449
look like this:
4550

0 commit comments

Comments
 (0)