From 96164014e8435870239c6e0f77cb60b174f08398 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 14 Jun 2020 17:56:55 -0700 Subject: [PATCH 1/3] Document min pointer width. --- src/conditional-compilation.md | 10 ++++++---- src/types/numeric.md | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/conditional-compilation.md b/src/conditional-compilation.md index 2b3925e91..0ec20f3f6 100644 --- a/src/conditional-compilation.md +++ b/src/conditional-compilation.md @@ -169,11 +169,13 @@ on the endianness of the target's CPU. ### `target_pointer_width` -Key-value option set once with the target's pointer width in bits. For example, -for targets with 32-bit pointers, this is set to `"32"`. Likewise, it is set -to `"64"` for targets with 64-bit pointers. +Key-value option set once with the target's pointer width in bits. - +Example values: + +* `"16"` +* `"32"` +* `"64"` ### `target_vendor` diff --git a/src/types/numeric.md b/src/types/numeric.md index 4d81be13b..5ff3b0e82 100644 --- a/src/types/numeric.md +++ b/src/types/numeric.md @@ -38,3 +38,5 @@ platform's pointer type. The theoretical upper bound on object and array size is the maximum `isize` value. This ensures that `isize` can be used to calculate differences between pointers into an object or array and can address every byte within an object along with one byte past the end. + +`usize` and `isize` are at least 16-bits wide. From 603cefcfae9f5f0c753adb0f77922fe8715b8295 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 12 Jul 2020 10:08:58 -0700 Subject: [PATCH 2/3] Add note clarifying 16-bit support. --- src/types/numeric.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/types/numeric.md b/src/types/numeric.md index 5ff3b0e82..ca3ee54f8 100644 --- a/src/types/numeric.md +++ b/src/types/numeric.md @@ -40,3 +40,8 @@ differences between pointers into an object or array and can address every byte within an object along with one byte past the end. `usize` and `isize` are at least 16-bits wide. + +> **Note**: Many pieces of Rust code may assume that pointers, `usize`, and +> `isize` are at least 32-bit and at most 64-bit. As a consequence, 16-bit +> pointer support is limited and may require explicit care and acknowledgment +> from a library to support. From e28d1de9f86c9f746e42b79bd6a6866a8211e97e Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 17 Jul 2020 12:37:02 -0700 Subject: [PATCH 3/3] Apply joshtriplett's suggestion Co-authored-by: Josh Triplett --- src/types/numeric.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/numeric.md b/src/types/numeric.md index ca3ee54f8..8ab53a792 100644 --- a/src/types/numeric.md +++ b/src/types/numeric.md @@ -42,6 +42,6 @@ within an object along with one byte past the end. `usize` and `isize` are at least 16-bits wide. > **Note**: Many pieces of Rust code may assume that pointers, `usize`, and -> `isize` are at least 32-bit and at most 64-bit. As a consequence, 16-bit +> `isize` are either 32-bit or 64-bit. As a consequence, 16-bit > pointer support is limited and may require explicit care and acknowledgment > from a library to support.