From d16cc47ae8e414613619754df50241f74a59d5d9 Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 8 Nov 2016 21:50:35 +0100 Subject: [PATCH] fixed #1331 --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index dd7f912e4f6..74a2b3e3feb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -226,9 +226,13 @@ pub fn main() { // this check ensures that dependencies are built but not linted and the final crate is // linted but not built - args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]); + let clippy_enabled = env::args().any(|s| s == "-Zno-trans"); - let mut ccc = ClippyCompilerCalls::new(env::args().any(|s| s == "-Zno-trans")); + if clippy_enabled { + args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]); + } + + let mut ccc = ClippyCompilerCalls::new(clippy_enabled); let (result, _) = rustc_driver::run_compiler(&args, &mut ccc, None, None); if let Err(err_count) = result {