Skip to content

Commit 16d8488

Browse files
committed
Combine internal features in clippy_utils
1 parent 5991695 commit 16d8488

File tree

6 files changed

+21
-22
lines changed

6 files changed

+21
-22
lines changed

.github/workflows/clippy.yml

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

6161
- name: Test clippy_utils
62-
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
62+
run: cargo test --features deny-warnings,internal
6363
working-directory: clippy_utils
6464

6565
- name: Test rustc_tools_util

.github/workflows/clippy_bors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
working-directory: clippy_lints
123123

124124
- name: Test clippy_utils
125-
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
125+
run: cargo test --features deny-warnings,internal
126126
working-directory: clippy_utils
127127

128128
- name: Test rustc_tools_util

clippy_lints/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ url = { version = "2.2", features = ["serde"] }
3030
[features]
3131
deny-warnings = ["clippy_utils/deny-warnings"]
3232
# build clippy with internal lints enabled, off by default
33-
internal-lints = ["clippy_utils/internal-lints"]
34-
metadata-collector-lint = ["serde_json", "clippy_utils/metadata-collector-lint"]
33+
internal-lints = ["clippy_utils/internal"]
34+
metadata-collector-lint = ["serde_json", "clippy_utils/internal"]
3535

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

clippy_utils/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ rustc-semver = "1.1"
1111

1212
[features]
1313
deny-warnings = []
14-
internal-lints = []
15-
metadata-collector-lint = []
14+
internal = []
1615

1716
[package.metadata.rust-analyzer]
1817
# 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
@@ -198,7 +198,7 @@ pub fn span_lint_hir_and_then(
198198
/// |
199199
/// = note: `-D fold-any` implied by `-D warnings`
200200
/// ```
201-
#[cfg_attr(feature = "internal-lints", allow(clippy::collapsible_span_lint_calls))]
201+
#[cfg_attr(feature = "internal", allow(clippy::collapsible_span_lint_calls))]
202202
pub fn span_lint_and_sugg<'a, T: LintContext>(
203203
cx: &'a T,
204204
lint: &'static Lint,

clippy_utils/src/paths.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
//! See <https://github.com/rust-lang/rust-clippy/issues/5393> for more information.
66
77
pub const ANY_TRAIT: [&str; 3] = ["core", "any", "Any"];
8-
#[cfg(feature = "metadata-collector-lint")]
8+
#[cfg(feature = "internal")]
99
pub const APPLICABILITY: [&str; 2] = ["rustc_lint_defs", "Applicability"];
10-
#[cfg(feature = "metadata-collector-lint")]
10+
#[cfg(feature = "internal")]
1111
pub const APPLICABILITY_VALUES: [[&str; 3]; 4] = [
1212
["rustc_lint_defs", "Applicability", "Unspecified"],
1313
["rustc_lint_defs", "Applicability", "HasPlaceholders"],
1414
["rustc_lint_defs", "Applicability", "MaybeIncorrect"],
1515
["rustc_lint_defs", "Applicability", "MachineApplicable"],
1616
];
17-
#[cfg(feature = "metadata-collector-lint")]
17+
#[cfg(feature = "internal")]
1818
pub const DIAGNOSTIC_BUILDER: [&str; 3] = ["rustc_errors", "diagnostic_builder", "DiagnosticBuilder"];
1919
pub const ARC_PTR_EQ: [&str; 4] = ["alloc", "sync", "Arc", "ptr_eq"];
2020
#[allow(clippy::invalid_paths)] // `check_path` does not seem to work for macros
@@ -45,7 +45,7 @@ pub const DISPLAY_TRAIT: [&str; 3] = ["core", "fmt", "Display"];
4545
pub const DOUBLE_ENDED_ITERATOR: [&str; 4] = ["core", "iter", "traits", "DoubleEndedIterator"];
4646
pub const DROP: [&str; 3] = ["core", "mem", "drop"];
4747
pub const DURATION: [&str; 3] = ["core", "time", "Duration"];
48-
#[cfg(feature = "internal-lints")]
48+
#[cfg(feature = "internal")]
4949
pub const EARLY_CONTEXT: [&str; 2] = ["rustc_lint", "EarlyContext"];
5050
#[allow(clippy::invalid_paths)] // `check_path` does not seem to work for macros
5151
pub const EPRINT_MACRO: [&str; 3] = ["std", "macros", "eprint"];
@@ -71,9 +71,9 @@ pub const HASH: [&str; 3] = ["core", "hash", "Hash"];
7171
pub const HASHMAP_CONTAINS_KEY: [&str; 6] = ["std", "collections", "hash", "map", "HashMap", "contains_key"];
7272
pub const HASHMAP_ENTRY: [&str; 5] = ["std", "collections", "hash", "map", "Entry"];
7373
pub const HASHMAP_INSERT: [&str; 6] = ["std", "collections", "hash", "map", "HashMap", "insert"];
74-
#[cfg(feature = "internal-lints")]
74+
#[cfg(feature = "internal")]
7575
pub const IDENT: [&str; 3] = ["rustc_span", "symbol", "Ident"];
76-
#[cfg(feature = "internal-lints")]
76+
#[cfg(feature = "internal")]
7777
pub const IDENT_AS_STR: [&str; 4] = ["rustc_span", "symbol", "Ident", "as_str"];
7878
pub const INDEX: [&str; 3] = ["core", "ops", "Index"];
7979
pub const INDEX_MUT: [&str; 3] = ["core", "ops", "IndexMut"];
@@ -85,11 +85,11 @@ pub const IPADDR_V6: [&str; 5] = ["std", "net", "ip", "IpAddr", "V6"];
8585
pub const ITER_REPEAT: [&str; 5] = ["core", "iter", "sources", "repeat", "repeat"];
8686
#[allow(clippy::invalid_paths)] // internal lints do not know about all external crates
8787
pub const ITERTOOLS_NEXT_TUPLE: [&str; 3] = ["itertools", "Itertools", "next_tuple"];
88-
#[cfg(feature = "internal-lints")]
88+
#[cfg(feature = "internal")]
8989
pub const KW_MODULE: [&str; 3] = ["rustc_span", "symbol", "kw"];
90-
#[cfg(feature = "internal-lints")]
90+
#[cfg(feature = "internal")]
9191
pub const LATE_CONTEXT: [&str; 2] = ["rustc_lint", "LateContext"];
92-
#[cfg(any(feature = "internal-lints", feature = "metadata-collector-lint"))]
92+
#[cfg(feature = "internal")]
9393
pub const LINT: [&str; 2] = ["rustc_lint_defs", "Lint"];
9494
pub const MEM_DISCRIMINANT: [&str; 3] = ["core", "mem", "discriminant"];
9595
pub const MEM_FORGET: [&str; 3] = ["core", "mem", "forget"];
@@ -179,17 +179,17 @@ pub const STR_ENDS_WITH: [&str; 4] = ["core", "str", "<impl str>", "ends_with"];
179179
pub const STR_FROM_UTF8: [&str; 4] = ["core", "str", "converts", "from_utf8"];
180180
pub const STR_LEN: [&str; 4] = ["core", "str", "<impl str>", "len"];
181181
pub const STR_STARTS_WITH: [&str; 4] = ["core", "str", "<impl str>", "starts_with"];
182-
#[cfg(feature = "internal-lints")]
182+
#[cfg(feature = "internal")]
183183
pub const SYMBOL: [&str; 3] = ["rustc_span", "symbol", "Symbol"];
184-
#[cfg(feature = "internal-lints")]
184+
#[cfg(feature = "internal")]
185185
pub const SYMBOL_AS_STR: [&str; 4] = ["rustc_span", "symbol", "Symbol", "as_str"];
186-
#[cfg(feature = "internal-lints")]
186+
#[cfg(feature = "internal")]
187187
pub const SYMBOL_INTERN: [&str; 4] = ["rustc_span", "symbol", "Symbol", "intern"];
188-
#[cfg(feature = "internal-lints")]
188+
#[cfg(feature = "internal")]
189189
pub const SYMBOL_TO_IDENT_STRING: [&str; 4] = ["rustc_span", "symbol", "Symbol", "to_ident_string"];
190-
#[cfg(feature = "internal-lints")]
190+
#[cfg(feature = "internal")]
191191
pub const SYM_MODULE: [&str; 3] = ["rustc_span", "symbol", "sym"];
192-
#[cfg(feature = "internal-lints")]
192+
#[cfg(feature = "internal")]
193193
pub const SYNTAX_CONTEXT: [&str; 3] = ["rustc_span", "hygiene", "SyntaxContext"];
194194
pub const TO_OWNED_METHOD: [&str; 4] = ["alloc", "borrow", "ToOwned", "to_owned"];
195195
pub const TO_STRING_METHOD: [&str; 4] = ["alloc", "string", "ToString", "to_string"];

0 commit comments

Comments
 (0)