rust-clippy
rust-clippy copied to clipboard
fix [`dbg_macro`] FN when `dbg` is inside some complex macros
fixes: #12131
It appears that [root_macro_call_first_node
] only detects println!
in the following example:
println!("{:?}", dbg!(s));
changelog: fix [dbg_macro
] FN when dbg
is inside some complex macros
r? @Jarcho
(rustbot has picked a reviewer for you, use r? to override)
Why are we even skipping nested calls in the first place? dbg!(foo(dbg!(bar)))
should still lint multiple times like we do with every other lint.
Why are we even skipping nested calls in the first place?
dbg!(foo(dbg!(bar)))
should still lint multiple times like we do with every other lint.
Idk, I guess the initial purpose was to warn the existence of dbg! macro thus linting the first one should suffice?
I didn't put that 'span.contains' check at first, instead it was 'macro_span = prev_macro_span', then I saw a lot additional warnings popping up, especially on line 28 of the test file.
Should I change it back to lint every nested calls?
Looks like it was quirk that was kept when switching from an early pass to a late pass. check_mac
only sees top level macro invocations and not anything from their expansion.
You can change it to lint all nested calls. You'll need to either split the test file in two since uitest only runs rustfix once, so nested macros won't pass testing. actual cargo fix
will run multiple times to handle this.
All looks good. Thank you. @bors r+
:pushpin: Commit aa06d416793ab2519ad2a7383ba865dee5a63b1d has been approved by Jarcho
It is now in the queue for this repository.
:hourglass: Testing commit aa06d416793ab2519ad2a7383ba865dee5a63b1d with merge 6e6dfd2fbb5a747188ca9334d307bfd2d800ec3e...
:broken_heart: Test failed - checks-action_test
You'll need to rebase to fix the test. How error patterns need to be placed when macros are used changed.
@bors r+
:pushpin: Commit b10159886828b0c5156f313b308aa48c7d05a68e has been approved by Jarcho
It is now in the queue for this repository.
:hourglass: Testing commit b10159886828b0c5156f313b308aa48c7d05a68e with merge 2d1dc10e2212eec8bd5b52319eec78ec90d0f439...
:sunny: Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test Approved by: Jarcho Pushing 2d1dc10e2212eec8bd5b52319eec78ec90d0f439 to master...
:eyes: Test was successful, but fast-forwarding failed: 422 1 review requesting changes by reviewers with write access.
One more time. @bors r+
:bulb: This pull request was already approved, no need to approve it again.
- This pull request previously failed. You should add more commits to fix the bug, or use
retry
to trigger a build again.
:pushpin: Commit b10159886828b0c5156f313b308aa48c7d05a68e has been approved by Jarcho
It is now in the queue for this repository.
:hourglass: Testing commit b10159886828b0c5156f313b308aa48c7d05a68e with merge b85eb7c5e158caebc47169e040adf8cfa24cd776...
:sunny: Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test Approved by: Jarcho Pushing b85eb7c5e158caebc47169e040adf8cfa24cd776 to master...
:eyes: Test was successful, but fast-forwarding failed: 422 1 review requesting changes by reviewers with write access.
@bors retry
:hourglass: Testing commit b10159886828b0c5156f313b308aa48c7d05a68e with merge 9991cb7f4d1e57eb72ef031db0b518b026fa2c51...
:sunny: Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test Approved by: Jarcho Pushing 9991cb7f4d1e57eb72ef031db0b518b026fa2c51 to master...
:eyes: Test was successful, but fast-forwarding failed: 422 1 review requesting changes by reviewers with write access.
Looks like rust-lang/homu#75
@bors retry
:hourglass: Testing commit b10159886828b0c5156f313b308aa48c7d05a68e with merge 7a72cdb12385b43e20294a083fbf89aa69f75c00...
:sunny: Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test Approved by: Jarcho Pushing 7a72cdb12385b43e20294a083fbf89aa69f75c00 to master...
:eyes: Test was successful, but fast-forwarding failed: 422 1 review requesting changes by reviewers with write access.
Lets see if this works today. @bors retry
:hourglass: Testing commit b10159886828b0c5156f313b308aa48c7d05a68e with merge 05570ade8ac6e75dd17b890b76f84e146ed61730...