fix literal_string_with_formatting_args FP on format inside assert#13898
fix literal_string_with_formatting_args FP on format inside assert#13898profetia wants to merge 1 commit intorust-lang:masterfrom
literal_string_with_formatting_args FP on format inside assert#13898Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Alexendoo (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
|
I'm not a clippy expert but this fix looks like a hack to me. Why don't we want to report these? The bug I reported is that this FP happens even when I put an |
|
@tamird I think you misunderstand my point. This FP happens because clippy is linting the panicked message generated by fn test_parse() {
if !parse(#[allow(clippy::literal_string_with_formatting_args)] "foo {:}").is_err()
{
::core::panicking::panic("assertion failed: parse(#[allow(clippy::literal_string_with_formatting_args)] \"foo {:}\").is_err()") // This is line is causing the FP
};
} |
|
I'm not sure this is the right fix. The problem here was that I was working on dummy spans, which is why the lint seemed to be emitted on completely unrelated code. I opened #13953. |
|
Closed in favor of #13953 |
fixes: #13885
I found that the error message generated by
assertis put on a root context, not sure if it is a bug on the compiler side (I testeddbgand everything went fine, though I do found the generated file name is on a root context too). I simply guarded the lint behindis_dummy.changelog: [
literal_string_with_formatting_args] fix FP on format inside assert