Skip to content

Commit 7a4b344

Browse files
BoxyUwUtraviscross
authored andcommitted
Refactor array types to consider the length a const argument
1 parent 272932c commit 7a4b344

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/types/array.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ r[type.array]
33

44
r[type.array.syntax]
55
```grammar,types
6-
ArrayType -> `[` Type `;` Expression `]`
6+
ArrayType -> `[` Type `;` GenericArgsConst `]`
77
```
88

99
r[type.array.intro]
1010
An array is a fixed-size sequence of `N` elements of type `T`. The array type
1111
is written as `[T; N]`.
1212

1313
r[type.array.constraint]
14-
The size is a [constant expression] that evaluates to a [`usize`].
14+
The size is a [const argument] of type [`usize`].
1515

1616
Examples:
1717

@@ -32,3 +32,4 @@ always bounds-checked in safe methods and operators.
3232
3333
[`usize`]: numeric.md#machine-dependent-integer-types
3434
[constant expression]: ../const_eval.md#constant-expressions
35+
[const argument]: ../items/generics.md##const-generics

0 commit comments

Comments
 (0)