Skip to content

Commit 4460db0

Browse files
committed
Move MSRV implementation to clippy_utils
1 parent 786fbd6 commit 4460db0

File tree

7 files changed

+6
-9
lines changed

7 files changed

+6
-9
lines changed

clippy_config/src/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use crate::ClippyConfiguration;
2-
use crate::msrvs::Msrv;
32
use crate::types::{
43
DisallowedPath, MacroMatcher, MatchLintBehaviour, PubUnderscoreFieldsBehaviour, Rename, SourceItemOrdering,
54
SourceItemOrderingCategory, SourceItemOrderingModuleItemGroupings, SourceItemOrderingModuleItemKind,
65
SourceItemOrderingTraitAssocItemKind, SourceItemOrderingTraitAssocItemKinds,
76
};
7+
use clippy_utils::msrvs::Msrv;
88
use rustc_errors::Applicability;
99
use rustc_session::Session;
1010
use rustc_span::edit_distance::edit_distance;

clippy_config/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,12 @@
1313
rustc::untranslatable_diagnostic
1414
)]
1515

16-
extern crate rustc_ast;
17-
extern crate rustc_attr;
18-
#[allow(unused_extern_crates)]
19-
extern crate rustc_driver;
2016
extern crate rustc_errors;
2117
extern crate rustc_session;
2218
extern crate rustc_span;
23-
extern crate smallvec;
2419

2520
mod conf;
2621
mod metadata;
27-
pub mod msrvs;
2822
pub mod types;
2923

3024
pub use conf::{Conf, get_configuration_metadata, lookup_conf_file, sanitize_explanation};

clippy_utils/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ arrayvec = { version = "0.7", default-features = false }
1010
itertools = "0.12"
1111
# FIXME(f16_f128): remove when no longer needed for parsing
1212
rustc_apfloat = "0.2.0"
13+
serde = { version = "1.0", features = ["derive"] }
1314

1415
[package.metadata.rust-analyzer]
1516
# This crate uses #[feature(rustc_private)]

clippy_utils/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ extern crate rustc_session;
5050
extern crate rustc_span;
5151
extern crate rustc_target;
5252
extern crate rustc_trait_selection;
53+
extern crate smallvec;
5354

5455
#[macro_use]
5556
pub mod sym_helper;
@@ -65,6 +66,7 @@ pub mod higher;
6566
mod hir_utils;
6667
pub mod macros;
6768
pub mod mir;
69+
pub mod msrvs;
6870
pub mod numeric_literal;
6971
pub mod paths;
7072
pub mod ptr;
File renamed without changes.

clippy_utils/src/paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub const CHILD_KILL: [&str; 4] = ["std", "process", "Child", "kill"];
3636
pub const PANIC_ANY: [&str; 3] = ["std", "panic", "panic_any"];
3737

3838
// Paths in clippy itself
39-
pub const MSRV: [&str; 3] = ["clippy_config", "msrvs", "Msrv"];
39+
pub const MSRV: [&str; 3] = ["clippy_utils", "msrvs", "Msrv"];
4040

4141
// Paths in external crates
4242
#[expect(clippy::invalid_paths)] // internal lints do not know about all external crates

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// of terminologies might not be relevant in the context of Clippy. Note that its behavior might
44
// differ from the time of `rustc` even if the name stays the same.
55

6-
use clippy_config::msrvs::{self, Msrv};
6+
use crate::msrvs::{self, Msrv};
77
use hir::LangItem;
88
use rustc_attr::StableSince;
99
use rustc_const_eval::check_consts::ConstCx;

0 commit comments

Comments
 (0)