Rust-clippy: match_single_binding triggers in generated code

Created on 23 Mar 2020  路  4Comments  路  Source: rust-lang/rust-clippy

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!

L-bug T-macros good-first-issue

Most helpful comment

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

All 4 comments

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

Issue has been fixed on rust-derivative in https://github.com/mcarton/rust-derivative/pull/71.

I believe we can close this issue.

This lint should still not trigger in external macros.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Riateche picture Riateche  路  3Comments

Robbepop picture Robbepop  路  3Comments

phansch picture phansch  路  3Comments

pickfire picture pickfire  路  3Comments

matthiaskrgr picture matthiaskrgr  路  3Comments