Closed
Description
I tried this code:
fn main() {
const BAD: [_; 3] = [1u8, 2u8, 3u8];
}
I expected to see this happen: an error which explains why this doesn't work with const
even though it does work with let
, like what would happen with the code:
fn main() {
const BAD = 1u8;
}
Instead, this happened: E0121, which doesn't explain that the problem is that const's need to be explicitly typed, but instead refers to an "item signature", which is an unexplained term of art. The explanation in rustc --explain E0121
does not elaborate on what an "item signature" means either.
Meta
rustc --version --verbose
:
Occurs on 1.52.1 stable and on 1.54.0 nightly.