From b06626eb53a6a969f594bc984a01e39f2c95d659 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Mon, 8 Jul 2019 16:36:49 +0200 Subject: [PATCH 1/2] Spell out when arrays have zero size --- reference/src/layout/arrays-and-slices.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/src/layout/arrays-and-slices.md b/reference/src/layout/arrays-and-slices.md index 375d1571..b6854e60 100644 --- a/reference/src/layout/arrays-and-slices.md +++ b/reference/src/layout/arrays-and-slices.md @@ -25,6 +25,11 @@ The _stride_ of the array is constant for all element pairs and it is computed as the _size_ of the element type rounded up to the next multiple of the _alignment_ of the element type. +### Arrays of zero-size + +Arrays `[T; N]` have zero size if their count `N` is zero, or their element `T` +has zero-size. + ### Special case `stride == size` When the element _size_ is a multiple of the element's _alignment_, then `stride @@ -42,6 +47,7 @@ pointer to the first element of the array by `i`[^1]. [layout of structs and tuples]: ./structs-and-tuples.md + ### Layout compatibility with packed SIMD vectors The [layout of packed SIMD vector types][Vector] [^2] requires the _size_ and From 6d17f7666e7e9d1b3dca4a4183456f31ba3ae9ab Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Sat, 13 Jul 2019 12:46:28 +0200 Subject: [PATCH 2/2] If and only if --- reference/src/layout/arrays-and-slices.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/src/layout/arrays-and-slices.md b/reference/src/layout/arrays-and-slices.md index b6854e60..de98851b 100644 --- a/reference/src/layout/arrays-and-slices.md +++ b/reference/src/layout/arrays-and-slices.md @@ -27,8 +27,8 @@ _alignment_ of the element type. ### Arrays of zero-size -Arrays `[T; N]` have zero size if their count `N` is zero, or their element `T` -has zero-size. +Arrays `[T; N]` have zero size if and only if their count `N` is zero or their +element type `T` is zero-sized. ### Special case `stride == size`