rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

Automatically set MSRV for code under `#[cfg(version)]`

Open Alexendoo opened this issue 7 months ago • 5 comments

Fixes https://github.com/rust-lang/rust-clippy/issues/14827

Semantics:

  • If there is both #[clippy::msrv] and #[cfg(version)] applying to the same node #[clippy::msrv] wins
  • When negated with not() version bounds are ignored (if double/quad/etc negated it will be applied once more)
  • Inside all/any the lowest found version is used

When the feature is stable we can go back and improve the docs a bit more with a better example

changelog: code using #[cfg(version)] will have the MSRV automatically detected

Alexendoo avatar May 31 '25 16:05 Alexendoo

r? @samueltardieu

rustbot has assigned @samueltardieu. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot avatar May 31 '25 16:05 rustbot

r? @flip1995

samueltardieu avatar May 31 '25 20:05 samueltardieu

Thanks.

samueltardieu avatar Jun 01 '25 13:06 samueltardieu

Sorry, I forgot I wanted to let @flip1995 weight in.

samueltardieu avatar Jun 01 '25 13:06 samueltardieu

Blocked on https://github.com/rust-lang/rust/pull/141766#issuecomment-2946372974

Alexendoo avatar Jun 12 '25 13:06 Alexendoo

:umbrella: The latest upstream changes (possibly #14896) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Aug 17 '25 11:08 rustbot

https://github.com/rust-lang/rust/pull/141766 was killed by bikeshedding again

Alexendoo avatar Dec 06 '25 14:12 Alexendoo