Skip to content

Referring to tool lints with paths that have redundant segments in the middle works #83477

Closed
@ghost

Description

I tried these code:

#[forbid(clippy::no::matter::how::many::useless::segments::here::it::always::works::empty_loop)]
fn _foo() -> ! {
    loop {}
}
#![forbid(rustdoc::no::matter::how::many::useless::segments::here::it::always::works::all)] // at least in crate root

I expected to see this happen: clippy or rustdoc reported them as unknown lints.

Instead, this happened: both clippy and rustdoc worked as if I specified clippy::empty_loop or rustdoc::all, without no::matter::how::many::useless::segments::here::it::always::works.

Meta

rustc version: 1.53.0-nightly (07e0e2e 2021-03-24)

Background

I discovered this through rust-analyzer, which tried to auto-complete something like #[allow(clippy::empty_loo with #[allow(clippy::clippy::empty_loop)], and then I found that syntax actually works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions