Open
Description
This is a spinoff of Issue #51308.
Using:
rustc 1.28.0-nightly (a805a2a5e 2018-06-10)
binary: rustc
commit-hash: a805a2a5ebba2802f432d79874e59c24e398f82a
commit-date: 2018-06-10
host: x86_64-pc-windows-gnu
release: 1.28.0-nightly
LLVM version: 6.0
On this code:
fn main() {
let a: [i32; 1] = [0; 1];
a[1];
}
Compiling with:
rustc test.rs
I get:
error: index out of bounds: the len is 1 but the index is 1
--> test.rs:3:5
|
3 | a[1];
| ^^^^
|
= note: #[deny(const_err)] on by default
Compiling with rustc --emit=metadata test.rs
I get no errors.