From 0293e3fa8fbc8fbc19f1d69d2a422071c8f7b2c0 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 17 Mar 2018 21:34:30 -0500 Subject: [PATCH 1/4] Add 128-bit ints to ch3 --- second-edition/src/ch03-02-data-types.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/second-edition/src/ch03-02-data-types.md b/second-edition/src/ch03-02-data-types.md index 7fc7cba282..2cbbc22ad6 100644 --- a/second-edition/src/ch03-02-data-types.md +++ b/second-edition/src/ch03-02-data-types.md @@ -50,13 +50,14 @@ value. Table 3-1: Integer Types in Rust -| Length | Signed | Unsigned | -|--------|---------|----------| -| 8-bit | `i8` | `u8` | -| 16-bit | `i16` | `u16` | -| 32-bit | `i32` | `u32` | -| 64-bit | `i64` | `u64` | -| arch | `isize` | `usize` | +| Length | Signed | Unsigned | +|---------|---------|----------| +| 8-bit | `i8` | `u8` | +| 16-bit | `i16` | `u16` | +| 32-bit | `i32` | `u32` | +| 64-bit | `i64` | `u64` | +| 128-bit | `i128` | `u128` | +| arch | `isize` | `usize` | Each variant can be either signed or unsigned and has an explicit size. *Signed* and *unsigned* refer to whether it’s possible for the number to be From 9ef40ac90b8eb2fb59909e70509f69e3b80fd8cd Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sun, 18 Mar 2018 14:38:55 -0500 Subject: [PATCH 2/4] Revert "Add 128-bit ints to ch3" This reverts commit 9ddb03a2d1e3cec8e4d2a1da0ad18b946afb1c53. --- second-edition/src/ch03-02-data-types.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/second-edition/src/ch03-02-data-types.md b/second-edition/src/ch03-02-data-types.md index 2cbbc22ad6..7fc7cba282 100644 --- a/second-edition/src/ch03-02-data-types.md +++ b/second-edition/src/ch03-02-data-types.md @@ -50,14 +50,13 @@ value. Table 3-1: Integer Types in Rust -| Length | Signed | Unsigned | -|---------|---------|----------| -| 8-bit | `i8` | `u8` | -| 16-bit | `i16` | `u16` | -| 32-bit | `i32` | `u32` | -| 64-bit | `i64` | `u64` | -| 128-bit | `i128` | `u128` | -| arch | `isize` | `usize` | +| Length | Signed | Unsigned | +|--------|---------|----------| +| 8-bit | `i8` | `u8` | +| 16-bit | `i16` | `u16` | +| 32-bit | `i32` | `u32` | +| 64-bit | `i64` | `u64` | +| arch | `isize` | `usize` | Each variant can be either signed or unsigned and has an explicit size. *Signed* and *unsigned* refer to whether it’s possible for the number to be From 5f9fb5243a28890399a6e13e0ac9650c51168566 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sun, 18 Mar 2018 14:47:31 -0500 Subject: [PATCH 3/4] Add 128-bit ints to newest features --- second-edition/src/appendix-06-newest-features.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/second-edition/src/appendix-06-newest-features.md b/second-edition/src/appendix-06-newest-features.md index 3f2e1ac3ae..841eb5a436 100644 --- a/second-edition/src/appendix-06-newest-features.md +++ b/second-edition/src/appendix-06-newest-features.md @@ -112,3 +112,18 @@ fn main() { The `...` syntax is still accepted in matches, but it is not accepted in expressions. `..=` should be preferred. + +## 128-bit integers + +Rust 1.26.0 added 128-bit integer primitives: + +- `u128`: A 128-bit unsigned integer with range [0, 2^128 - 1] +- `i128`: A 128-bit signed integer with range [-(2^127), 2^127 - 1] + +These primitive are implemented efficiently via LLVM support. They +are available even on platforms that don't natively support 128-bit +integers and can be used like the other integer types. + +These primitives can be very useful for algorithms that need to use +very large integers efficiently, such as certain cryptographic +algorithms. From ce3eb47fdb316612eb686fe2f2ce89283fc0696a Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Mon, 19 Mar 2018 10:44:05 -0500 Subject: [PATCH 4/4] Update dictionary --- second-edition/dictionary.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/second-edition/dictionary.txt b/second-edition/dictionary.txt index 6147d8f7b2..1abbb31604 100644 --- a/second-edition/dictionary.txt +++ b/second-edition/dictionary.txt @@ -75,6 +75,7 @@ CPUs cratesio CRLF cryptocurrencies +cryptographic cryptographically CStr CString @@ -227,6 +228,7 @@ libreoffice libstd lifecycle LimitTracker +LLVM lobally locators LockResult @@ -272,6 +274,7 @@ namespace namespaced namespaces namespacing +natively newfound NewJob NewsArticle