From e4dceef7e79c96c4ddeffd59a2c532bd239f98a6 Mon Sep 17 00:00:00 2001 From: mcarton Date: Wed, 29 Jun 2016 13:58:07 +0200 Subject: [PATCH] Revert "Automatically defines the `clippy` feature" This reverts commit d7ba66bf44f993e64114e17cc15f1b0d56ae8f70. It was causing problems with crates with: ```rust #![cfg_attr(feature="clippy", plugin(clippy))] ``` --- CHANGELOG.md | 2 ++ README.md | 7 ------- src/main.rs | 7 +------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a71b410a5f60..168d7a12065e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. ## 0.0.78 - TBA * New lints: [`wrong_transmute`] +* For compatibility, `cargo clippy` does not defines the `clippy` feature + introduced in 0.0.76 anymore ## 0.0.77 — 2016-06-21 * Rustup to *rustc 1.11.0-nightly (5522e678b 2016-06-20)* diff --git a/README.md b/README.md index 5096ee953b20..2f54835d5387 100644 --- a/README.md +++ b/README.md @@ -326,13 +326,6 @@ You can add options to `allow`/`warn`/`deny`: Note: `deny` produces errors instead of warnings. -For convenience, `cargo clippy` automatically defines a `clippy` features. This -lets you set lints level and compile with or without clippy transparently: - -```rust -#[cfg_attr(feature = "clippy", allow(needless_lifetimes))] -``` - ## Link with clippy service `clippy-service` is a rust web initiative providing `rust-clippy` as a web service. diff --git a/src/main.rs b/src/main.rs index cf57926440bd..17a219cafa08 100644 --- a/src/main.rs +++ b/src/main.rs @@ -149,14 +149,11 @@ pub fn main() { } } } else { - let mut args: Vec = if env::args().any(|s| s == "--sysroot") { + let args: Vec = if env::args().any(|s| s == "--sysroot") { env::args().collect() } else { env::args().chain(Some("--sysroot".to_owned())).chain(Some(sys_root)).collect() }; - - args.extend_from_slice(&["--cfg".to_owned(), r#"feature="clippy""#.to_owned()]); - let (result, _) = rustc_driver::run_compiler(&args, &mut ClippyCompilerCalls::new()); if let Err(err_count) = result { @@ -187,8 +184,6 @@ fn process(old_args: I, dep_path: P, sysroot: &str) -> Result<(), i32> args.push(String::from("--sysroot")); args.push(sysroot.to_owned()); args.push("-Zno-trans".to_owned()); - args.push("--cfg".to_owned()); - args.push(r#"feature="clippy""#.to_owned()); let path = std::env::current_exe().expect("current executable path invalid"); let exit_status = std::process::Command::new("cargo")