Skip to content

Stronger macro check for identity-op and type-complexity #301

@llogiq

Description

@llogiq

Macros are both used to make types easier to read and to create basic operations, sometimes relying on the compiler to remove identity operations so the macro is easier. Therefore I have written a new utility method in_macro that is more strict than in_external_macro, on the grounds that we want to rule out all macro expansion for some lints, e.g. the ones above (I'll make a PR shortly once my current rust build finishes).

In the meantime I want to discuss which other lints should rule out not only internal but external macros? I share @Manishearth's uneasiness about false positives (not only) resulting from macro expansion, however, we should not throw out the baby with the bathwater.

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingS-needs-discussionStatus: Needs further discussion before merging or work can be startedT-middleType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions