Skip to content

Badly worded note for non-constant array length #41871

Closed
@durka

Description

@durka
let len = 42;
let arr = [0; len];

rustc 1.0.0 - 1.11.0: error: expected constant integer for repeat count, found variable
rustc 1.12.0 - 1.15.0: non-constant path in constant expression
rustc 1.16.0 - present: non-constant used with constant

Can we have the first one back please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-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