Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghost opened this issue Mar 25, 2021 · 2 comments · Fixed by #84064
Closed

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

ghost opened this issue Mar 25, 2021 · 2 comments · Fixed by #84064
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ghost
Copy link

ghost commented Mar 25, 2021

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.

@ghost ghost added the C-bug Category: This is a bug. label Mar 25, 2021
@jonas-schievink jonas-schievink added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. labels Mar 25, 2021
@camelid camelid added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Mar 25, 2021
@camelid camelid changed the title Referring tool lints with paths that have redundant segments in the middle works Referring to tool lints with paths that have redundant segments in the middle works Mar 25, 2021
@apiraino
Copy link
Contributor

Assigning priority as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Mar 31, 2021
@JohnTitor JohnTitor added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 3, 2021
@ghost
Copy link
Author

ghost commented Apr 10, 2021

@rustbot claim

@rustbot rustbot assigned ghost Apr 10, 2021
jyn514 pushed a commit to jyn514/rust that referenced this issue Apr 16, 2021
Do not ignore path segments in the middle in `#[allow]`/`#[warn]`/`#[deny]`/`#[forbid]` attributes

Fixes rust-lang#83477.
@bors bors closed this as completed in dc99219 Apr 18, 2021
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 22, 2021
Do not ignore path segments in the middle in `#[allow]`/`#[warn]`/`#[deny]`/`#[forbid]` attributes

Fixes rust-lang#83477.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants