Consider extending unused_parens
to {}
, particularly in const generics
#68387
Labels
A-const-generics
Area: const generics (parameters and arguments)
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
In const generics,
{}
are required for complex expressions in const generic arguments (e.g.{M + N}
). They are not required, however, for literals and standalone parameters (in most cases). However, at least at the moment, it is quite common to see curly brackets in user code for all generic arguments. This may be a passing phase, as generic arguments only recently started being disambiguated; however, if it is not, we might want to lint on extraneous{}
to inform users.This might be useful outside of const generis too, such as in:
The text was updated successfully, but these errors were encountered: