Skip to content

Clippy does not run on proc macro crates #2526

Closed
@dtolnay

Description

@dtolnay
#!/bin/sh

cargo new repro
echo >repro/src/lib.rs '
#[allow(dead_code)]
fn f() {
    let _x = 3.14;
}
'

echo >>repro/Cargo.toml '
[lib]
proc-macro = true
'

cargo clippy --manifest-path=repro/Cargo.toml

The same script without proc-macro = true does catch the approx_constant lint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tT-macrosType: Issues with macros and macro expansion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions