2025-04-10 15:30:28 +01:00
|
|
|
error[E0284]: type annotations needed for `[String; _]`
|
2025-06-11 15:30:15 +01:00
|
|
|
--> $DIR/copy-check-const-element-uninferred-count.rs:62:9
|
2025-04-10 15:11:55 +01:00
|
|
|
|
|
|
|
|
|
LL | let a = [const { String::new() }; _];
|
2025-04-10 15:30:28 +01:00
|
|
|
| ^ ---------------------------- type must be known at this point
|
2025-04-10 15:11:55 +01:00
|
|
|
|
|
2025-04-10 15:30:28 +01:00
|
|
|
= note: the length of array `[String; _]` must be type `usize`
|
|
|
|
|
help: consider giving `a` an explicit type, where the placeholders `_` are specified
|
2025-04-10 15:11:55 +01:00
|
|
|
|
|
2025-04-10 15:30:28 +01:00
|
|
|
LL | let a: [_; _] = [const { String::new() }; _];
|
2025-04-10 15:11:55 +01:00
|
|
|
| ++++++++
|
|
|
|
|
|
2025-04-10 15:30:28 +01:00
|
|
|
error: aborting due to 1 previous error
|
2025-04-10 15:11:55 +01:00
|
|
|
|
2025-04-10 15:30:28 +01:00
|
|
|
For more information about this error, try `rustc --explain E0284`.
|