Skip to content

Commit 1452021

Browse files
authored
Merge pull request #1034 from owengage/patch-1
Be more precise about array offset in type layouts
2 parents d9699fa + 0cb7e46 commit 1452021

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/type-layout.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ at least equal to the size and alignment of a pointer.
7070
7171
## Array Layout
7272

73-
Arrays are laid out so that the `nth` element of the array is offset from the
74-
start of the array by `n * the size of the type` bytes. An array of `[T; n]`
75-
has a size of `size_of::<T>() * n` and the same alignment of `T`.
73+
An array of `[T; N]` has a size of `size_of::<T>() * N` and the same alignment
74+
of `T`. Arrays are laid out so that the zero-based `nth` element of the array
75+
is offset from the start of the array by `n * size_of::<T>()` bytes.
7676

7777
## Slice Layout
7878

0 commit comments

Comments
 (0)