Rust unstable book: basic desc and example for const_indexing.
This commit is contained in:
parent
327e8e9196
commit
0dd03ffaf7
1 changed files with 9 additions and 0 deletions
|
|
@ -6,5 +6,14 @@ The tracking issue for this feature is: [#29947]
|
|||
|
||||
------------------------
|
||||
|
||||
The `const_indexing` feature allows the constant evaluation of index operations
|
||||
on constant arrays and repeat expressions.
|
||||
|
||||
## Examples
|
||||
|
||||
```rust
|
||||
#![feature(const_indexing)]
|
||||
|
||||
const ARR: [usize; 5] = [1, 2, 3, 4, 5];
|
||||
const ARR2: [usize; ARR[1]] = [42, 99];
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue