diff options
Diffstat (limited to 'src/test/compile-fail/const-array-oob.rs')
| -rw-r--r-- | src/test/compile-fail/const-array-oob.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/compile-fail/const-array-oob.rs b/src/test/compile-fail/const-array-oob.rs index 84d35292608..da9f6bd247e 100644 --- a/src/test/compile-fail/const-array-oob.rs +++ b/src/test/compile-fail/const-array-oob.rs @@ -9,7 +9,10 @@ // except according to those terms. const FOO: [u32; 3] = [1, 2, 3]; -const BAR: u32 = FOO[5]; //~ ERROR const index-expr is out of bounds +const BAR: u32 = FOO[5]; // no error, because the error below occurs before regular const eval + +const BLUB: [u32; FOO[4]] = [5, 6]; +//~^ ERROR array length constant evaluation error: array index out of bounds [E0250] fn main() { let _ = BAR; |
