Skip to content

Commit 325e9fd

Browse files
committed
Auto merge of #11723 - Alexendoo:clippy-utils-internal, r=Jarcho
Remove internal feature from clippy_utils It's only used to gate a few `const`s, removing the feature gate means it doesn't have to be recompiled when moving between a normal and `-F internal` build/test/etc changelog: none
2 parents e245f7c + f4b4e2c commit 325e9fd

File tree

6 files changed

+6
-25
lines changed

6 files changed

+6
-25
lines changed

.github/workflows/clippy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
working-directory: clippy_lints
6161

6262
- name: Test clippy_utils
63-
run: cargo test --features deny-warnings,internal
63+
run: cargo test --features deny-warnings
6464
working-directory: clippy_utils
6565

6666
- name: Test rustc_tools_util

.github/workflows/clippy_bors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
working-directory: clippy_lints
121121

122122
- name: Test clippy_utils
123-
run: cargo test --features deny-warnings,internal
123+
run: cargo test --features deny-warnings
124124
working-directory: clippy_utils
125125

126126
- name: Test clippy_config

clippy_lints/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ url = "2.2"
3333
walkdir = "2.3"
3434

3535
[features]
36-
deny-warnings = ["clippy_utils/deny-warnings"]
36+
deny-warnings = ["clippy_config/deny-warnings", "clippy_utils/deny-warnings"]
3737
# build clippy with internal lints enabled, off by default
38-
internal = ["clippy_utils/internal", "serde_json", "tempfile", "regex"]
38+
internal = ["serde_json", "tempfile", "regex"]
3939

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

clippy_utils/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ itertools = "0.10.1"
1212
rustc-semver = "1.1"
1313

1414
[features]
15-
deny-warnings = []
16-
internal = []
15+
deny-warnings = ["clippy_config/deny-warnings"]
1716

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

clippy_utils/src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub fn span_lint_hir_and_then(
193193
/// |
194194
/// = note: `-D fold-any` implied by `-D warnings`
195195
/// ```
196-
#[cfg_attr(feature = "internal", allow(clippy::collapsible_span_lint_calls))]
196+
#[expect(clippy::collapsible_span_lint_calls)]
197197
pub fn span_lint_and_sugg<T: LintContext>(
198198
cx: &T,
199199
lint: &'static Lint,

clippy_utils/src/paths.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44
//! Whenever possible, please consider diagnostic items over hardcoded paths.
55
//! See <https://github.com/rust-lang/rust-clippy/issues/5393> for more information.
66
7-
#[cfg(feature = "internal")]
87
pub const APPLICABILITY: [&str; 2] = ["rustc_lint_defs", "Applicability"];
9-
#[cfg(feature = "internal")]
108
pub const APPLICABILITY_VALUES: [[&str; 3]; 4] = [
119
["rustc_lint_defs", "Applicability", "Unspecified"],
1210
["rustc_lint_defs", "Applicability", "HasPlaceholders"],
1311
["rustc_lint_defs", "Applicability", "MaybeIncorrect"],
1412
["rustc_lint_defs", "Applicability", "MachineApplicable"],
1513
];
16-
#[cfg(feature = "internal")]
1714
pub const DIAGNOSTIC_BUILDER: [&str; 3] = ["rustc_errors", "diagnostic_builder", "DiagnosticBuilder"];
1815
pub const BINARYHEAP_ITER: [&str; 5] = ["alloc", "collections", "binary_heap", "BinaryHeap", "iter"];
1916
pub const BTREEMAP_CONTAINS_KEY: [&str; 6] = ["alloc", "collections", "btree", "map", "BTreeMap", "contains_key"];
@@ -25,9 +22,7 @@ pub const CORE_ITER_COPIED: [&str; 6] = ["core", "iter", "traits", "iterator", "
2522
pub const CORE_ITER_FILTER: [&str; 6] = ["core", "iter", "traits", "iterator", "Iterator", "filter"];
2623
pub const CORE_RESULT_OK_METHOD: [&str; 4] = ["core", "result", "Result", "ok"];
2724
pub const CSTRING_AS_C_STR: [&str; 5] = ["alloc", "ffi", "c_str", "CString", "as_c_str"];
28-
#[cfg(feature = "internal")]
2925
pub const EARLY_CONTEXT: [&str; 2] = ["rustc_lint", "EarlyContext"];
30-
#[cfg(feature = "internal")]
3126
pub const EARLY_LINT_PASS: [&str; 3] = ["rustc_lint", "passes", "EarlyLintPass"];
3227
pub const F32_EPSILON: [&str; 4] = ["core", "f32", "<impl f32>", "EPSILON"];
3328
pub const F64_EPSILON: [&str; 4] = ["core", "f64", "<impl f64>", "EPSILON"];
@@ -38,21 +33,14 @@ pub const FUTURES_IO_ASYNCWRITEEXT: [&str; 3] = ["futures_util", "io", "AsyncWri
3833
pub const HASHMAP_CONTAINS_KEY: [&str; 6] = ["std", "collections", "hash", "map", "HashMap", "contains_key"];
3934
pub const HASHMAP_INSERT: [&str; 6] = ["std", "collections", "hash", "map", "HashMap", "insert"];
4035
pub const HASHSET_ITER: [&str; 6] = ["std", "collections", "hash", "set", "HashSet", "iter"];
41-
#[cfg(feature = "internal")]
4236
pub const IDENT: [&str; 3] = ["rustc_span", "symbol", "Ident"];
43-
#[cfg(feature = "internal")]
4437
pub const IDENT_AS_STR: [&str; 4] = ["rustc_span", "symbol", "Ident", "as_str"];
4538
pub const INSERT_STR: [&str; 4] = ["alloc", "string", "String", "insert_str"];
4639
pub const ITERTOOLS_NEXT_TUPLE: [&str; 3] = ["itertools", "Itertools", "next_tuple"];
47-
#[cfg(feature = "internal")]
4840
pub const KW_MODULE: [&str; 3] = ["rustc_span", "symbol", "kw"];
49-
#[cfg(feature = "internal")]
5041
pub const LATE_CONTEXT: [&str; 2] = ["rustc_lint", "LateContext"];
51-
#[cfg(feature = "internal")]
5242
pub const LATE_LINT_PASS: [&str; 3] = ["rustc_lint", "passes", "LateLintPass"];
53-
#[cfg(feature = "internal")]
5443
pub const LINT: [&str; 2] = ["rustc_lint_defs", "Lint"];
55-
#[cfg(feature = "internal")]
5644
pub const MSRV: [&str; 3] = ["clippy_config", "msrvs", "Msrv"];
5745
pub const OS_STRING_AS_OS_STR: [&str; 5] = ["std", "ffi", "os_str", "OsString", "as_os_str"];
5846
pub const OS_STR_TO_OS_STRING: [&str; 5] = ["std", "ffi", "os_str", "OsStr", "to_os_string"];
@@ -86,17 +74,11 @@ pub const STR_CHARS: [&str; 4] = ["core", "str", "<impl str>", "chars"];
8674
pub const STR_ENDS_WITH: [&str; 4] = ["core", "str", "<impl str>", "ends_with"];
8775
pub const STR_LEN: [&str; 4] = ["core", "str", "<impl str>", "len"];
8876
pub const STR_STARTS_WITH: [&str; 4] = ["core", "str", "<impl str>", "starts_with"];
89-
#[cfg(feature = "internal")]
9077
pub const SYMBOL: [&str; 3] = ["rustc_span", "symbol", "Symbol"];
91-
#[cfg(feature = "internal")]
9278
pub const SYMBOL_AS_STR: [&str; 4] = ["rustc_span", "symbol", "Symbol", "as_str"];
93-
#[cfg(feature = "internal")]
9479
pub const SYMBOL_INTERN: [&str; 4] = ["rustc_span", "symbol", "Symbol", "intern"];
95-
#[cfg(feature = "internal")]
9680
pub const SYMBOL_TO_IDENT_STRING: [&str; 4] = ["rustc_span", "symbol", "Symbol", "to_ident_string"];
97-
#[cfg(feature = "internal")]
9881
pub const SYM_MODULE: [&str; 3] = ["rustc_span", "symbol", "sym"];
99-
#[cfg(feature = "internal")]
10082
pub const SYNTAX_CONTEXT: [&str; 3] = ["rustc_span", "hygiene", "SyntaxContext"];
10183
#[expect(clippy::invalid_paths)] // internal lints do not know about all external crates
10284
pub const TOKIO_IO_ASYNCREADEXT: [&str; 5] = ["tokio", "io", "util", "async_read_ext", "AsyncReadExt"];

0 commit comments

Comments
 (0)