-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.