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

"Lint reasons are experimental" not flagged by clippy for rust-version without support for them #13406

Open
IceTDrinker opened this issue Sep 17, 2024 · 1 comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages

Comments

@IceTDrinker
Copy link

Summary

Looked for issues with "rust-version reason" could not find anything.

Asked on zulip here https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Lint.20reasons.20are.20experimental.20not.20detected.20with.20rust-version

reproduced here

Hello I have a project with

rust-version = "1.76"

but it does not seem to detect that allow attributes with "reason" is not available in 1.76, it does not raise an issue in a clippy run, does that sound like a bug ?

was advised to open an issue if I did not find one in the clippy issues. The person advising to open an issue cites "language properties" (like this case) and "trait implementations" as being things clippy does not track very well

Cheers

Reproducer

I tried this code:

#[allow(dead_code, reason = "reproducer for the issue")]
struct MyThing {
    unused_field: bool
}

I expected to see this happen:

Get a warning from clippy given the min rust-version of the project is 1.76 and does not support "allow with reason" (stabilized in 1.81)

Instead, this happened:

No warnings

Version

rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7

Additional Labels

No response

@IceTDrinker IceTDrinker added the C-bug Category: Clippy is not doing the correct thing label Sep 17, 2024
@Jarcho
Copy link
Contributor

Jarcho commented Sep 17, 2024

We don't have any lint that would cover this right now. incompatible_msrv only covers library items, not language features.

@Jarcho Jarcho added C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages and removed C-bug Category: Clippy is not doing the correct thing labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages
Projects
None yet
Development

No branches or pull requests

2 participants