Conversation
|
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
|
Thanks for this. As you pointed out in #9349 this is closely related to the other format/write/print PRs. So I'll mark this a |
|
☔ The latest upstream changes (presumably #9349) made this pull request unmergeable. Please resolve the merge conflicts. |
to_string_in_format_args false positive|
#9349 does seem to have resolved the issue. I think the only question that remains is whether you would like this PR's test. |
|
Ah great! Thanks for revisiting this. I would have gone back to this once the write.rs rewrite was merged. We definitely want the regression test. @bors r+ |
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fix #8855
Here is what I think is going on.
First, the expression
format!("{:>6} {:>6}", a, b.to_string())expands to:When I dump the expressions that get past the call to
has_string_formattinghere, I see more than I would expect.In particular, I see this subexpression of the above:
This suggests to me that more expressions are getting past this call to
FormatArgsExpn::parsethan should.Those expressions are then visited, but no
::core::fmt::rt::v1::Arguments are found and pushed here.As a result, the expressions appear unformatted, hence, the false positive.
My proposed fix is to restrict
FormatArgsExpn::parseso that it only matchesCallexpressions.cc: @akanalytics
changelog: none