diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 7668d4dd0b1..1a74f641554 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1005,7 +1005,11 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: store.register_late_pass(|| box utils::internal_lints::OuterExpnDataPass); } #[cfg(feature = "metadata-collector-lint")] - store.register_late_pass(|| box utils::internal_lints::metadata_collector::MetadataCollector::default()); + { + if std::env::var("ENABLE_METADATA_COLLECTION").eq(&Ok("1".to_string())) { + store.register_late_pass(|| box utils::internal_lints::metadata_collector::MetadataCollector::default()); + } + } store.register_late_pass(|| box utils::author::Author); store.register_late_pass(|| box await_holding_invalid::AwaitHolding); diff --git a/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/clippy_lints/src/utils/internal_lints/metadata_collector.rs index 37e90bf8686..07abae31386 100644 --- a/clippy_lints/src/utils/internal_lints/metadata_collector.rs +++ b/clippy_lints/src/utils/internal_lints/metadata_collector.rs @@ -148,24 +148,6 @@ struct LintMetadata { applicability: Option, } -// impl Ord for LintMetadata { -// fn cmp(&self, other: &Self) -> Ordering { -// self.id.cmp(&other.id) -// } -// } -// -// impl PartialOrd for LintMetadata { -// fn partial_cmp(&self, other: &Self) -> Option { -// Some(self.cmp(other)) -// } -// } -// -// impl PartialEq for LintMetadata { -// fn eq(&self, other: &Self) -> bool { -// self.id == other.id -// } -// } - impl LintMetadata { fn new(id: String, id_span: SerializableSpan, group: String, docs: String) -> Self { Self { diff --git a/tests/dogfood.rs b/tests/dogfood.rs index 604968ad8b0..6524fd4706c 100644 --- a/tests/dogfood.rs +++ b/tests/dogfood.rs @@ -22,12 +22,14 @@ fn dogfood_clippy() { return; } let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + let enable_metadata_collection = std::env::var("ENABLE_METADATA_COLLECTION").unwrap_or_else(|_| "0".to_string()); let mut command = Command::new(&*CLIPPY_PATH); command .current_dir(root_dir) .env("CLIPPY_DOGFOOD", "1") .env("CARGO_INCREMENTAL", "0") + .env("ENABLE_METADATA_COLLECTION", &enable_metadata_collection) .arg("clippy") .arg("--all-targets") .arg("--all-features")