Skip to content

typos inside cfg macros go undetected #5051

@JOE1994

Description

@JOE1994

The below program has typos inside the cfg macro call.
(feeture instead of feature)

The below program compiles without any errors, and clippy also does not print any warnings.

pub fn main() {
    if cfg!(feeture="EXT1") {
        println!("EXTRA FEATURE1 ADDED");
    }
    #[cfg(feeture="EXT2")] {
        println!("EXTRA FEATURE2 ADDED");
    }
}

cfg macro seems to be a compiler built-in macro (source code not available?).
I found this issue while debugging my Rust code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsT-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