-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fe35b2f5f585f0303661ac61e880d1fe
const NUMBERS: [i32; _] = [
1, 2, 3
];
The current output is:
error[[E0658]](https://doc.rust-lang.org/stable/error-index.html#E0658): using `_` for array lengths is unstable
--> src/lib.rs:1:22
|
1 | const NUMBERS: [i32; _] = [
| ^
|
= note: [see issue #85077 <https://github.com/rust-lang/rust/issues/85077>](https://github.com/rust-lang/rust/issues/85077) for more information
error: in expressions, `_` can only be used on the left-hand side of an assignment
--> src/lib.rs:1:22
|
1 | const NUMBERS: [i32; _] = [
| ^ `_` not allowed here
For more information about this error, try `rustc --explain E0658`.
error: could not compile `playground` due to 2 previous errors
Ideally, the output should suggest that this should be [i32; 3].
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.