Skip to content

Clippy reports errors from macro even if they are marked with allow(clippy::all) #11132

Closed
@DrSloth

Description

@DrSloth

Summary

This error occurred while writing code with sqlx in the macro expansion the code is marked with #[allow(clippy::all)] but the lints arithmetic_side_effects and missing_panic_docs still fire.

The second one might still make sense to keep because it CAN panic but in the sqlx sense that should never happen.

Reproducer

I tried this code:
Any sqlx query with bind parameters should work

sqlx::query_as!(Foo, "SELECT boo, baz FROM Foos WHERE boo > $1 AND baz < $2", 10, 20)

I expected to see this happen:
No errors reported

Instead, this happened:
Clippy reports arithmetic_side_effects because it increments the bind parameter count. Also it reports missing_panic_docs because sqlx panics if the database schema is wrong.

Version

rustc 1.70.0 (90c541806 2023-05-31)
binary: rustc
commit-hash: 90c541806f23a127002de5b4038be731ba1458ca
commit-date: 2023-05-31
host: x86_64-unknown-linux-gnu
release: 1.70.0
LLVM version: 16.0.2

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions