Skip to content

Enabling keyword_idents lints doesn't warn about violations in other files #132218

Open
@Zalathar

Description

@Zalathar

Consider this tiny two-file crate:

// main.rs
#![deny(keyword_idents)]

mod submod;

fn main() {}
// submod.rs
fn async() {}
fn await() {}
fn try() {}
fn dyn() {}
fn gen() {}

Building this crate should fail with several violations of the keyword_idents_2018 and keyword_idents_2024 lints. But instead, building unexpectedly succeeds!

(This particular example requires Rust 2015, but the same issue can be observed in 2018/2021 regarding the gen keyword only.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions