Skip to content
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

match_single_binding triggers in generated code #5362

Closed
znewman01 opened this issue Mar 23, 2020 · 4 comments · Fixed by #5476
Closed

match_single_binding triggers in generated code #5362

znewman01 opened this issue Mar 23, 2020 · 4 comments · Fixed by #5476
Labels
C-bug Category: Clippy is not doing the correct thing good-first-issue These issues are a good way to get started with Clippy T-macros Type: Issues with macros and macro expansion

Comments

@znewman01
Copy link

Hi! I'm using rust-derivative, which appears to generate code that triggers match_single_binding; see rust-derivative#58 for a full report (version info, etc.).

The developer considers this a Clippy bug, and I'm inclined to agree: the cited reason for this lint is "readability and needless complexity", which seems okay for macro-generated code. The discussion in #4949 seems to back me up.

P.S. Thanks for a great tool!

@flip1995
Copy link
Member

This lint should be disabled for external macros. cc @ThibsG

@flip1995 flip1995 added good-first-issue These issues are a good way to get started with Clippy C-bug Category: Clippy is not doing the correct thing T-macros Type: Issues with macros and macro expansion labels Mar 23, 2020
@ThibsG
Copy link
Contributor

ThibsG commented Apr 15, 2020

Issue has been fixed on rust-derivative in mcarton/rust-derivative#71.

I believe we can close this issue.

@flip1995
Copy link
Member

This lint should still not trigger in external macros.

@ThibsG
Copy link
Contributor

ThibsG commented Apr 15, 2020

Oh right, it should be extended, it only checks for check_expr case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing good-first-issue These issues are a good way to get started with Clippy T-macros Type: Issues with macros and macro expansion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants