-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Fix suggestion spans inside macros for the unused_must_use
lint
#143030
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
base: master
Are you sure you want to change the base?
Conversation
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
@bors r+ |
Fix suggestion spans inside macros for the `unused_must_use` lint This PR fixes the suggestion spans inside macros for the `unused_must_use` lint by trying to find the oldest ancestor span. Fixes rust-lang#143025
Rollup of 9 pull requests Successful merges: - #124595 (Suggest cloning `Arc` moved into closure) - #139594 (Simplify `ObligationCauseCode::IfExpression`) - #141311 (make `tidy-alphabetical` use a natural sort) - #141648 ([rustdoc] Do not emit redundant_explicit_links lint if the doc comment comes from expansion) - #142285 (tests: Do not run afoul of asm.validity.non-exhaustive in input-stats) - #142393 (Don't give APITs names with macro expansion placeholder fragments in it) - #142884 (StableMIR: Add method to retrieve body of coroutine) - #142981 (Make missing lifetime suggestion verbose) - #143030 (Fix suggestion spans inside macros for the `unused_must_use` lint) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- |
@ehuss @weihanglo I'm not sure how to fix the your test. With this PR are no longer suggesting inside the macro, which is exactly what your test was testing. Any idea how to fix it/unblock this PR? We are also generating a FWC warning, but that's not the real issue. |
) ### What does this PR try to resolve? This PR changes the triggering `rustc` lint in the `fix_only_once_for_duplicates` test from `unused_must_use` to `forgetting_references`, because we are changing in rust-lang/rust#143030 the interaction between that lint and macros. This is required as it blocking the rust PR, rust-lang/rust#143030 (comment). ### How to test and review this PR? Look at the test changes.
This PR fixes the suggestion spans inside macros for the
unused_must_use
lint by trying to find the oldest ancestor span.Fixes #143025