diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2015-11-20 10:43:04 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2015-11-20 10:43:04 +0100 |
| commit | 64051221b624ef35a449213bc54dc631ffa8a65b (patch) | |
| tree | cb9f0c51f30ef28ef479407f52a708c4373e54cd /src/test | |
| parent | 6683fa4d425d3ca2f2ba6b5a48dc073956ad0f13 (diff) | |
| download | rust-64051221b624ef35a449213bc54dc631ffa8a65b.tar.gz rust-64051221b624ef35a449213bc54dc631ffa8a65b.zip | |
add feature gate `const_indexing`
tracking issue is #29947
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/const-array-oob-arith.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/const-array-oob.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/array_const_index-1.rs | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/src/test/compile-fail/const-array-oob-arith.rs b/src/test/compile-fail/const-array-oob-arith.rs index bca3cd74d24..9c07abdc36d 100644 --- a/src/test/compile-fail/const-array-oob-arith.rs +++ b/src/test/compile-fail/const-array-oob-arith.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(const_indexing)] + const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47]; const IDX: usize = 3; const VAL: i32 = ARR[IDX]; diff --git a/src/test/compile-fail/const-array-oob.rs b/src/test/compile-fail/const-array-oob.rs index da9f6bd247e..15426febbcd 100644 --- a/src/test/compile-fail/const-array-oob.rs +++ b/src/test/compile-fail/const-array-oob.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(const_indexing)] + const FOO: [u32; 3] = [1, 2, 3]; const BAR: u32 = FOO[5]; // no error, because the error below occurs before regular const eval diff --git a/src/test/run-pass/array_const_index-1.rs b/src/test/run-pass/array_const_index-1.rs index 63f0a844880..3e4504eb195 100644 --- a/src/test/run-pass/array_const_index-1.rs +++ b/src/test/run-pass/array_const_index-1.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(const_indexing)] fn main() { const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47]; |
