1

Suppress the triggering of some lints in derived structures by c410-f3r · Pull R...

 1 year ago
source link: https://github.com/rust-lang/rust-clippy/pull/10203
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Suppress the triggering of some lints in derived structures #10203

Conversation

Contributor

Fixes #10185
Fixes #10417

For integer_arithmetic, arithmetic_side_effects and shadow_reuse.

  • Not sure how to test these use-cases so feel free to point any method or any related PR.

changelog: FP: [integer_arithmetic], [arithmetic_side_effects]: No longer lint inside proc macros
#10203

michaelsproul reacted with heart emoji

Collaborator

r? @giraffate

(rustbot has picked a reviewer for you, use r? to override)

rustbot

added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label

Jan 14, 2023

Contributor

Not sure how to test these use-cases so feel free to point any method or any related PR.

This is a reference to adding tests for the derived struct: #9043
We use compiletest for tests, so this documents is helpful: https://rustc-dev-guide.rust-lang.org/tests/compiletest.html#building-auxiliary-crates

If you have any questions, feel free to ask me.

Member

Hey @c410-f3r, would you mind listing the lints that are affected by this change, for the changelog entry? upside_down_face

Contributor

Author

Not sure how to test these use-cases so feel free to point any method or any related PR.

This is a reference to adding tests for the derived struct: #9043 We use compiletest for tests, so this documents is helpful: https://rustc-dev-guide.rust-lang.org/tests/compiletest.html#building-auxiliary-crates

If you have any questions, feel free to ask me.

Thank you @giraffate

Contributor

Author

Hey @c410-f3r, would you mind listing the lints that are affected by this change, for the changelog entry? upside_down_face

xFrednet reacted with heart emoji

Contributor

This doesn't fix #9757 as quote doesn't use #[automatically_derived]. See @Alexendoo's comment on the issue for a likely fix.

Member

Hey @c410-f3r, would you mind listing the lints that are affected by this change, for the changelog entry? upside_down_face

Thank you!

Contributor

umbrella The latest upstream changes (presumably #10310) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

Hey @c410-f3r would you be able to resolve the merge conflicts here? I'm happy to help in any way I can, but seems like you've got it covered.

Contributor

Author

This doesn't fix #9757 as quote doesn't use #[automatically_derived]. See @Alexendoo's comment on the issue for a likely fix.

Well, that is unfortunate...

Tests are now using statements that were manually created.

Contributor

Author

Hey @c410-f3r would you be able to resolve the merge conflicts here? I'm happy to help in any way I can, but seems like you've got it covered.

The actual fix needed more than a rebase but everything should probably be fine now

Contributor

Author

ping @giraffate

I can re-roll if you don't have the time to review

Contributor

umbrella The latest upstream changes (presumably #10585) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

Thanks for letting me know! I'll review this in this week.

michaelsproul reacted with heart emoji

Contributor

@giraffate giraffate

left a comment

Overall looks good. I made small comments.

question: For shadow_reuse, does this pull request just add a test?

changelog: FP: [integer_arithmetic], [arithmetic_side_effects], [shadow_reuse]: No longer lint inside proc macros

Contributor

Author

Overall looks good. I made small comments.

question: For shadow_reuse, does this pull request just add a test?

changelog: FP: [integer_arithmetic], [arithmetic_side_effects], [shadow_reuse]: No longer lint inside proc macros

Yeah, just modified the changelog.

Initially I tried to solve #9757 but it turns out that such thing shouldn't happen because shadow_reuse already has a ident.span.from_expansion() guard. I will try to investigate in a following PR but would appreciate if the test can be kept for reference and enhanced robustness.

Contributor

@bors r+

Thanks!

Contributor

pushpin Commit d639062 has been approved by giraffate

It is now in the queue for this repository.

Contributor

hourglass Testing commit d639062 with merge f1a552c...

Contributor

michaelsproul reacted with hooray emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Jarcho

Jarcho left review comments

giraffate

giraffate approved these changes
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects

None yet

Milestone

No milestone

7 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK