Skip to content

Missing index out of bounds error #48920

Closed
@varkor

Description

@varkor

The following example no longer throws a warning about indices being out of bounds, on master:

fn main() {
    let a: [i32; 1] = [0; 1];
    a[1];
}

I expect a index out of bounds: the len is 1 but the index is 1 error. I suspect this is due to #46882.

cc @oli-obk

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions