Skip to content

Commit

Permalink
Rename incompatible_msrv lint into incompatible_minimum_rust_version
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jan 25, 2024
1 parent 69c6fa3 commit 830b891
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/declared_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
crate::implicit_saturating_add::IMPLICIT_SATURATING_ADD_INFO,
crate::implicit_saturating_sub::IMPLICIT_SATURATING_SUB_INFO,
crate::implied_bounds_in_impls::IMPLIED_BOUNDS_IN_IMPLS_INFO,
crate::incompatible_msrv::INCOMPATIBLE_MSRV_INFO,
crate::incompatible_msrv::INCOMPATIBLE_MINIMUM_RUST_VERSION_INFO,
crate::inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR_INFO,
crate::index_refutable_slice::INDEX_REFUTABLE_SLICE_INFO,
crate::indexing_slicing::INDEXING_SLICING_INFO,
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/incompatible_msrv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare_clippy_lint! {
/// To fix this problem, either increase your MSRV or use another item
/// available in your current MSRV.
#[clippy::version = "1.77.0"]
pub INCOMPATIBLE_MSRV,
pub INCOMPATIBLE_MINIMUM_RUST_VERSION,
suspicious,
"ensures that all items used in the crate are available for the current MSRV"
}
Expand All @@ -43,7 +43,7 @@ pub struct IncompatibleMsrv {
is_above_msrv: FxHashMap<DefId, RustcVersion>,
}

impl_lint_pass!(IncompatibleMsrv => [INCOMPATIBLE_MSRV]);
impl_lint_pass!(IncompatibleMsrv => [INCOMPATIBLE_MINIMUM_RUST_VERSION]);

impl IncompatibleMsrv {
pub fn new(msrv: Msrv) -> Self {
Expand Down Expand Up @@ -96,7 +96,7 @@ impl IncompatibleMsrv {
fn emit_lint_for(&self, cx: &LateContext<'_>, span: Span, version: RustcVersion) {
span_lint(
cx,
INCOMPATIBLE_MSRV,
INCOMPATIBLE_MINIMUM_RUST_VERSION,
span,
&format!(
"current MSRV (Minimum Supported Rust Version) is `{}` but this item is stable since `{version}`",
Expand Down
15 changes: 12 additions & 3 deletions tests/ui/incompatible_msrv.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
error: unknown lint: `clippy::incompatible_msrv`
--> $DIR/incompatible_msrv.rs:1:9
|
LL | #![warn(clippy::incompatible_msrv)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D unknown-lints` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unknown_lints)]`

error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.10.0`
--> $DIR/incompatible_msrv.rs:13:39
|
LL | assert_eq!(map.entry("poneyland").key(), &"poneyland");
| ^^^^^
|
= note: `-D clippy::incompatible-msrv` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::incompatible_msrv)]`
= note: `-D clippy::incompatible-minimum-rust-version` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::incompatible_minimum_rust_version)]`

error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.12.0`
--> $DIR/incompatible_msrv.rs:15:11
Expand All @@ -19,5 +28,5 @@ error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is
LL | sleep(Duration::new(1, 0));
| ^^^^^

error: aborting due to 3 previous errors
error: aborting due to 4 previous errors

0 comments on commit 830b891

Please sign in to comment.