Divergent suggestion "expressions must be enclosed in braces to be used as const generic arguments" #103144
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I noticed this while trying to understand #103143.
Given the following code (playground):
The current output starts with:
Why this doesn't work
Adding the braces as suggested:
doesn't fix the problem, and the compiler continues suggesting to add more braces indefinitely:
Possible alternative
The suggestion could place the opening brace before the
#[a]
, i.e.:This at least leads to a different error message:
The text was updated successfully, but these errors were encountered: