]> git.lizzy.rs Git - rust.git/commitdiff
Rust unstable book: basic desc and example for `const_indexing`.
authorCorey Farwell <coreyf@rwell.org>
Sun, 12 Mar 2017 01:50:18 +0000 (20:50 -0500)
committerCorey Farwell <coreyf@rwell.org>
Tue, 14 Mar 2017 01:38:24 +0000 (21:38 -0400)
src/doc/unstable-book/src/const-indexing.md

index bd92b0b1b478fdc3422f261f4aaa6162d6634d1b..42d46ce15f676e552025619097bd9c90c17730e3 100644 (file)
@@ -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];
+```
\ No newline at end of file