-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
unused_parens false positive on braced macro calls #78747
Comments
Assigning |
Note that the parenthesis are required due to the fact that we have special handling for macro invocations with curly braces: rust/compiler/rustc_parse/src/parser/stmt.rs Lines 108 to 111 in b2d115f
Without the parenthesis, we parse |
The suggestion is valid as of #88690 (included in 1.57.0). |
I tried this code:
I expected to see this happen: No warning about unnecessary parens
Instead, this happened: A warning about unnecessary parens suggesting to remove parens. Attempting to actually follow the advice causes an error.
This can be worked around by using
x!().to_string
or(x! {}).to_string()
instead, however this shouldn't be necessary as the original code is fine.This happens since Rust 1.42.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: