Files
rust/tests/ui/repeat-expr/copy-check-const-element-uninferred-count.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
597 B
Plaintext
Raw Normal View History

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() }; _];
| ^ ---------------------------- type must be known at this point
2025-04-10 15:11:55 +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
|
LL | let a: [_; _] = [const { String::new() }; _];
2025-04-10 15:11:55 +01:00
| ++++++++
error: aborting due to 1 previous error
2025-04-10 15:11:55 +01:00
For more information about this error, try `rustc --explain E0284`.