-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest const block, instead of const item, for array repeat of non-Copy element #126894
Comments
@rustbot claim |
Is that a thing? I am not sure |
|
Ah, thank you! Completely missed it. Should I make the Should I add the |
…r=davidtwco Suggest inline const blocks for array initialization rust-lang#126894
…r=davidtwco Suggest inline const blocks for array initialization rust-lang#126894
…r=davidtwco Suggest inline const blocks for array initialization rust-lang#126894
Rollup merge of rust-lang#126899 - GrigorenkoPV:suggest-const-block, r=davidtwco Suggest inline const blocks for array initialization rust-lang#126894
Close it since #126899 is merged. |
Code
Current output
Rationale and extra context
Rustc's suggestion to make this code compile with a non-Copy type is:
Instead it should be:
Relatedly, now that const blocks are a stable part of the language since Rust 1.79 (https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html#inline-const-expressions), I don't think the diagnostic should be linking to the initial const block RFC.
Rust Version
The text was updated successfully, but these errors were encountered: