Skip to content

Renamed lints not honored in attributes #82615

New issue

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

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

Already on GitHub? # to your account

Closed
ehuss opened this issue Feb 28, 2021 · 0 comments · Fixed by #82620
Closed

Renamed lints not honored in attributes #82615

ehuss opened this issue Feb 28, 2021 · 0 comments · Fixed by #82620
Assignees
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another.

Comments

@ehuss
Copy link
Contributor

ehuss commented Feb 28, 2021

I tried this code:

#![deny(single_use_lifetime)]
fn _foo<'a>(_x: &'a u32) {}

I expected to see this happen: Should generate an error due to the deny attribute.

Instead, this happened: Generates a warning about the renamed lint (single_use_lifetime -> single_use_lifetimes), but otherwise does not generate an error.

Note that lints passed on the command-line (like -D single_use_lifetime) do work as expected.

History

It looks like this behavior was broken in #43522 (first released in 1.21). It worked properly in 1.20. I don't see any discussion there about renaming, so I am assuming this was unintended. At the time, there was only one renamed lint (unknown_features -> unused_features), so I suspect there just wasn't much attention to it.

It looks like at various points there were attempts to add tests for these kinds of things (#30878 added the lint-renamed.rs test, which doesn't actually validate that the renamed lint works, just that it emits a warning).

Tested up to latest rustc 1.52.0-nightly (9c09c1f 2021-02-26)

@ehuss ehuss added the C-bug Category: This is a bug. label Feb 28, 2021
@camelid camelid added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. labels Feb 28, 2021
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 28, 2021
@jyn514 jyn514 self-assigned this Feb 28, 2021
@bors bors closed this as completed in 6808802 Mar 1, 2021
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 6, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants