Skip to content

Getting "unknown lint: clippy::elidable_lifetime_names" using clippy 1.85.1 #14653

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

Open
corneliusroemer opened this issue Apr 19, 2025 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@corneliusroemer
Copy link

corneliusroemer commented Apr 19, 2025

Update: Turns out the version annotation was wrong. Here's a PR to fix it: #14654

Summary

I'm getting an "unknown lint" warning for clippy::elidable_lifetime_names despite using rust/clippy version 1.85.1 which is later than the version clippy::elidable_lifetime_names was introduced in: 1.84.0 per https://rust-lang.github.io/rust-clippy/master/index.html#/elid)

Interestingly I couldn't find the lint in the stable branch, only on master. Is that why I'm getting the lint? If so, shouldn't the docs distinguish between the version something landed on stable?

Lint Name

unknown lint: clippy::elidable_lifetime_names

Reproducer

I tried this code:

#![allow(
    clippy::elidable_lifetime_names,
)]

fn main() {
    println!("Hello, world!");
}

I saw this happen:

cargo clippy
    Checking tmp2 v0.1.0 (/Users/cr/code/tmp2)
warning: unknown lint: `clippy::elidable_lifetime_names`
 --> src/main.rs:3:5
  |
3 |     clippy::elidable_lifetime_names,
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::single_char_lifetime_names`
  |
  = note: `#[warn(unknown_lints)]` on by default

warning: `tmp2` (bin "tmp2") generated 1 warning
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s

I expected to see this happen: No lint

Version

rustc 1.85.1 (4eb161250 2025-03-15)
binary: rustc
commit-hash: 4eb161250e340c8f48f66e2b929ef4a5bed7c181
commit-date: 2025-03-15
host: aarch64-apple-darwin
release: 1.85.1
LLVM version: 19.1.7

Additional Labels

No response

@corneliusroemer corneliusroemer added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Apr 19, 2025
corneliusroemer added a commit to corneliusroemer/rust-clippy that referenced this issue Apr 19, 2025
Resolves rust-lang#14653

It might be good to have some automation to check that the version is correct.
IIUC the version should be the current nightly version at the time a PR is merged.
If a release happens while a PR is open, the version needs to be bumped - this is easy to forget.
@corneliusroemer
Copy link
Author

Some further wrong versions:

  • clippy::mem_replace_option_with_some: should be 1.87 not 1.86
  • clippy::manual_dangling_ptr: should be 1.88 not 1.87
  • clippy::char_indices_as_byte_indices: should be 1.88 not 1.83
  • clippy::manual_abs_diff should be 1.88 not 1.86
  • clippy::ignore_without_reason should be 1.88 not 1.85

I found these by letting clippy 1.87 run on a file with all the declared lints (on master), looking for unknown lints and their official vs actual version of introduction.

@corneliusroemer
Copy link
Author

corneliusroemer commented Apr 20, 2025

Some more, checking what's missing down up to 1.82:

  • clippy:single_option_map should be 1.87 not 1.86
  • clippy::owned_cow should be 1.87 not 1.85
  • clippy::manual_contains should be 1.87 not 1.86
  • clippy::manual_abs_diff should be 1.87 not 1.86
  • clippy::doc_link_code should be 1.87 not 1.86
  • clippy::inverted_saturating_sub should be 1.83 not 1.44

corneliusroemer added a commit to corneliusroemer/rust-clippy that referenced this issue Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

No branches or pull requests

1 participant