Skip to content

Commit 2541604

Browse files
committed
Remove the implementation-defined bit and pieces
1 parent 228258b commit 2541604

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

reference/src/layout/scalars.md

+9-14
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,20 @@ They have the same layout as the [pointer types] for which the pointee is
4141
> `unsigned` is at least as large as a short, allowed to have padding bits, etc.
4242
> but it is not necessarily pointer-sized.
4343
44-
The layout of `usize` determine the following:
45-
46-
- the maximum size of Rust values is _implementation-defined_, but can at most
47-
be `usize::max_value` since `mem::size_of` and `mem::size_of_val` return
48-
`usize`,
49-
- the maximum number of elements in an array is _implementation-defined_, but
50-
can at most be `usize::max_value()` since `[T; N: usize]`,
51-
- the maximum value by which a pointer can be offseted is
52-
_implementation-defined_, but can at most be `usize::max_value()` since
53-
`ptr.add(count: usize)`.
54-
55-
> **Note**: in the current Rust implementation:
44+
> **Note**: in the current Rust implementation, the layouts of `isize` and
45+
> `usize` determine the following:
5646
>
5747
> * the maximum size of Rust values is limited to `isize::max_value()`. The LLVM
5848
> `getelementptr` instruction uses signed-integer field offsets. Rust calls
5949
> `getelementptr` with the `inbounds` flag which assumes that field offsets do
6050
> not overflow,
61-
> * the maximum number of elements in an array is `usize::max_value()`,
62-
> * the maximum value by which a pointer can be offseted is `usize::max_value()`.
51+
> * the maximum number of elements in an array is `usize::max_value()` (`[T; N:
52+
> usize]`),
53+
> * the maximum value by which a pointer can be offseted using `ptr.add(count:
54+
> usize)` is `usize::max_value()`.
55+
>
56+
> These limits have not gone through the RFC process and are not guaranteed to
57+
> hold.
6358
6459
[pointer types]: ./pointers.md
6560

0 commit comments

Comments
 (0)