Skip to content

Commit 1816361

Browse files
committed
Auto merge of #8257 - camsteffen:internal-features, r=giraffate
Combine internal cargo features changelog: none This is just simpler and I don't see any downsides.
2 parents 88cfd70 + e2ce4f9 commit 1816361

File tree

17 files changed

+58
-65
lines changed

17 files changed

+58
-65
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
uitest = "test --test compile-test"
33
dev = "run --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
44
lintcheck = "run --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
5-
collect-metadata = "test --test dogfood --features metadata-collector-lint -- run_metadata_collection_lint --ignored"
5+
collect-metadata = "test --test dogfood --features internal -- run_metadata_collection_lint --ignored"
66

77
[build]
88
# -Zbinary-dep-depinfo allows us to track which rlib files to use for compiling UI tests

.github/workflows/clippy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ jobs:
4949
echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
5050
5151
- name: Build
52-
run: cargo build --features deny-warnings,internal-lints,metadata-collector-lint
52+
run: cargo build --features deny-warnings,internal
5353

5454
- name: Test
55-
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
55+
run: cargo test --features deny-warnings,internal
5656

5757
- name: Test clippy_lints
58-
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
58+
run: cargo test --features deny-warnings,internal
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,17 @@ jobs:
112112
echo "$SYSROOT/bin" >> $GITHUB_PATH
113113
114114
- name: Build
115-
run: cargo build --features deny-warnings,internal-lints,metadata-collector-lint
115+
run: cargo build --features deny-warnings,internal
116116

117117
- name: Test
118-
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
118+
run: cargo test --features deny-warnings,internal
119119

120120
- name: Test clippy_lints
121-
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
121+
run: cargo test --features deny-warnings,internal
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

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ rustc_tools_util = { version = "0.2", path = "rustc_tools_util" }
5757
[features]
5858
deny-warnings = ["clippy_lints/deny-warnings"]
5959
integration = ["tempfile"]
60-
internal-lints = ["clippy_lints/internal-lints"]
61-
metadata-collector-lint = ["internal-lints", "clippy_lints/metadata-collector-lint"]
60+
internal = ["clippy_lints/internal"]
6261

6362
[package.metadata.rust-analyzer]
6463
# This package uses #[feature(rustc_private)]

clippy_dev/src/update_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ fn gen_register_lint_list<'a>(
321321

322322
for (is_public, module_name, lint_name) in details {
323323
if !is_public {
324-
output.push_str(" #[cfg(feature = \"internal-lints\")]\n");
324+
output.push_str(" #[cfg(feature = \"internal\")]\n");
325325
}
326326
output.push_str(&format!(" {}::{},\n", module_name, lint_name));
327327
}

clippy_lints/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ 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 = ["clippy_utils/internal", "serde_json"]
3534

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

clippy_lints/src/lib.register_lints.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33
// Manual edits will be overwritten.
44

55
store.register_lints(&[
6-
#[cfg(feature = "internal-lints")]
6+
#[cfg(feature = "internal")]
77
utils::internal_lints::CLIPPY_LINTS_INTERNAL,
8-
#[cfg(feature = "internal-lints")]
8+
#[cfg(feature = "internal")]
99
utils::internal_lints::COLLAPSIBLE_SPAN_LINT_CALLS,
10-
#[cfg(feature = "internal-lints")]
10+
#[cfg(feature = "internal")]
1111
utils::internal_lints::COMPILER_LINT_FUNCTIONS,
12-
#[cfg(feature = "internal-lints")]
12+
#[cfg(feature = "internal")]
1313
utils::internal_lints::DEFAULT_LINT,
14-
#[cfg(feature = "internal-lints")]
14+
#[cfg(feature = "internal")]
1515
utils::internal_lints::IF_CHAIN_STYLE,
16-
#[cfg(feature = "internal-lints")]
16+
#[cfg(feature = "internal")]
1717
utils::internal_lints::INTERNING_DEFINED_SYMBOL,
18-
#[cfg(feature = "internal-lints")]
18+
#[cfg(feature = "internal")]
1919
utils::internal_lints::INVALID_CLIPPY_VERSION_ATTRIBUTE,
20-
#[cfg(feature = "internal-lints")]
20+
#[cfg(feature = "internal")]
2121
utils::internal_lints::INVALID_PATHS,
22-
#[cfg(feature = "internal-lints")]
22+
#[cfg(feature = "internal")]
2323
utils::internal_lints::LINT_WITHOUT_LINT_PASS,
24-
#[cfg(feature = "internal-lints")]
24+
#[cfg(feature = "internal")]
2525
utils::internal_lints::MATCH_TYPE_ON_DIAGNOSTIC_ITEM,
26-
#[cfg(feature = "internal-lints")]
26+
#[cfg(feature = "internal")]
2727
utils::internal_lints::MISSING_CLIPPY_VERSION_ATTRIBUTE,
28-
#[cfg(feature = "internal-lints")]
28+
#[cfg(feature = "internal")]
2929
utils::internal_lints::OUTER_EXPN_EXPN_DATA,
30-
#[cfg(feature = "internal-lints")]
30+
#[cfg(feature = "internal")]
3131
utils::internal_lints::PRODUCE_ICE,
32-
#[cfg(feature = "internal-lints")]
32+
#[cfg(feature = "internal")]
3333
utils::internal_lints::UNNECESSARY_SYMBOL_STR,
3434
absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS,
3535
approx_const::APPROX_CONSTANT,

clippy_lints/src/lib.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,9 @@ macro_rules! declare_clippy_lint {
153153
};
154154
}
155155

156-
#[cfg(feature = "metadata-collector-lint")]
156+
#[cfg(feature = "internal")]
157157
mod deprecated_lints;
158-
#[cfg_attr(
159-
any(feature = "internal-lints", feature = "metadata-collector-lint"),
160-
allow(clippy::missing_clippy_version_attribute)
161-
)]
158+
#[cfg_attr(feature = "internal", allow(clippy::missing_clippy_version_attribute))]
162159
mod utils;
163160

164161
// begin lints modules, do not remove this comment, it’s used in `update_lints`
@@ -472,7 +469,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
472469
include!("lib.register_restriction.rs");
473470
include!("lib.register_pedantic.rs");
474471

475-
#[cfg(feature = "internal-lints")]
472+
#[cfg(feature = "internal")]
476473
include!("lib.register_internal.rs");
477474

478475
include!("lib.register_all.rs");
@@ -484,7 +481,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
484481
include!("lib.register_cargo.rs");
485482
include!("lib.register_nursery.rs");
486483

487-
#[cfg(feature = "metadata-collector-lint")]
484+
#[cfg(feature = "internal")]
488485
{
489486
if std::env::var("ENABLE_METADATA_COLLECTION").eq(&Ok("1".to_string())) {
490487
store.register_late_pass(|| Box::new(utils::internal_lints::metadata_collector::MetadataCollector::new()));
@@ -493,7 +490,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
493490
}
494491

495492
// all the internal lints
496-
#[cfg(feature = "internal-lints")]
493+
#[cfg(feature = "internal")]
497494
{
498495
store.register_early_pass(|| Box::new(utils::internal_lints::ClippyLintsInternal));
499496
store.register_early_pass(|| Box::new(utils::internal_lints::ProduceIce));

clippy_lints/src/utils/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ macro_rules! define_Conf {
113113
}
114114
}
115115

116-
#[cfg(feature = "metadata-collector-lint")]
116+
#[cfg(feature = "internal")]
117117
pub mod metadata {
118118
use crate::utils::internal_lints::metadata_collector::ClippyConfiguration;
119119

clippy_lints/src/utils/internal_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use rustc_typeck::hir_ty_to_ty;
3535

3636
use std::borrow::{Borrow, Cow};
3737

38-
#[cfg(feature = "metadata-collector-lint")]
38+
#[cfg(feature = "internal")]
3939
pub mod metadata_collector;
4040

4141
declare_clippy_lint! {

0 commit comments

Comments
 (0)