diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2025-07-16 16:24:01 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-16 16:24:01 +0000 |
| commit | c0dc3b616da6d4f2f53ee1da4139dc258cf9b27f (patch) | |
| tree | 3792afdceccead023663b52648aacbf88d00f122 /compiler/rustc_codegen_gcc/example/alloc_system.rs | |
| parent | e113e66606834f0b8eb992c02798f1c737c6cac8 (diff) | |
| parent | 68ea46179b912e58ef9511559ba7b30ea569def0 (diff) | |
| download | rust-c0dc3b616da6d4f2f53ee1da4139dc258cf9b27f.tar.gz rust-c0dc3b616da6d4f2f53ee1da4139dc258cf9b27f.zip | |
Various improvements to the `incompatible_msrv` lint (#14433)
This PR supersedes #14328 following the [2025-03-18 Clippy meeting discussion](https://rust-lang.zulipchat.com/#narrow/channel/257328-clippy/topic/Meeting.202025-03-18/with/506527762). It uses a simpler approach than what was proposed initially in #14328 and does not add new options. First, it documents how `cfg_attr` can be used to change the MSRV considered by Clippy to trigger the lint. This allows the MSRV to be feature gated, or to be raised in tests. Also, the lint stops warning about items which have been explicitly allowed through a rustc feature. This works even if the feature has been stabilized since. It allows using an older compiler with some features turned on, as is done in Rust for Linux. This fixes #14425. Then, if the lint triggers, and it looks like the code is located below a `cfg` or `cfg_attr` attribute, an additional note is issued, once, to indicate that the `clippy::msrv` attribute can be controlled by an attribute. Finally, the lint is extended to cover any path, not just method and function calls. For example, enumeration variants, or constants, were not MSRV checked. This required replacing two `u32::MAX` by `u32::max_value()` in MSRV-limited tests. An extra commit adds a TODO for checking the const stability also, as this is not done right now. @Centri3 I'll assign this to you because you were assigned #14328 and you were the one who nominated the issue for discussion (thanks!), but of course feel free to reroll! r? @Centri3 changelog: [`incompatible_msrv`]: better documentation, honor the `features` attribute, and lint non-function entities as well
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/alloc_system.rs')
0 files changed, 0 insertions, 0 deletions
