-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Incorrect fix for to_string_in_format_args #9540
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
Comments
This is unrelated to |
@Alexendoo why do you think that? In these examples of uninlined-format-args test that also fails, just like the See the build results in https://github.com/rust-lang/rust-clippy/pull/9548/checks |
Haven't looked into that one but looks like a different issue. For this it's because the parenthesis are part of the expression's span, when it does rust-clippy/clippy_lints/src/format_args.rs Line 270 in 5825ae7
|
Thanks @Alexendoo, you are right uninlined_format_args issue was due to a bug that I now have a PR for: #9588 As for the current issue in the For the test case, I think I figured it out thanks to your help! See #9590. Sorry to step on your toes on this one. |
@rustbot claim |
I just discovered another bug in the format args parserFormatArgsExpn::parse
while creating more tests for #9233.Add this test case to the tests/ui/format_args.rs
main()
to see it fail:The resultingformat_args.args[0].param.value
has a span does NOT include the surrounding parenthesis, which means that it suggest this:Auto-fix is incorrectly suggesting this:
which results in an incompilabre
cc: @Alexendoo
The text was updated successfully, but these errors were encountered: