@@ -41,25 +41,20 @@ They have the same layout as the [pointer types] for which the pointee is
41
41
> ` unsigned ` is at least as large as a short, allowed to have padding bits, etc.
42
42
> but it is not necessarily pointer-sized.
43
43
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:
56
46
>
57
47
> * the maximum size of Rust values is limited to ` isize::max_value() ` . The LLVM
58
48
> ` getelementptr ` instruction uses signed-integer field offsets. Rust calls
59
49
> ` getelementptr ` with the ` inbounds ` flag which assumes that field offsets do
60
50
> 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.
63
58
64
59
[ pointer types ] : ./pointers.md
65
60
0 commit comments