Skip to content

Commit 0dd03ff

Browse files
committed
Rust unstable book: basic desc and example for const_indexing.
1 parent 327e8e9 commit 0dd03ff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/doc/unstable-book/src/const-indexing.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,14 @@ The tracking issue for this feature is: [#29947]
66

77
------------------------
88

9+
The `const_indexing` feature allows the constant evaluation of index operations
10+
on constant arrays and repeat expressions.
911

12+
## Examples
1013

14+
```rust
15+
#![feature(const_indexing)]
16+
17+
const ARR: [usize; 5] = [1, 2, 3, 4, 5];
18+
const ARR2: [usize; ARR[1]] = [42, 99];
19+
```

0 commit comments

Comments
 (0)