-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.

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