Skip to content

Commit c56b8df

Browse files
authored
Merge pull request #1332 from debris/fixed_1331
fixed #1331
2 parents c687fe7 + d16cc47 commit c56b8df

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,13 @@ pub fn main() {
226226

227227
// this check ensures that dependencies are built but not linted and the final crate is
228228
// linted but not built
229-
args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]);
229+
let clippy_enabled = env::args().any(|s| s == "-Zno-trans");
230230

231-
let mut ccc = ClippyCompilerCalls::new(env::args().any(|s| s == "-Zno-trans"));
231+
if clippy_enabled {
232+
args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]);
233+
}
234+
235+
let mut ccc = ClippyCompilerCalls::new(clippy_enabled);
232236
let (result, _) = rustc_driver::run_compiler(&args, &mut ccc, None, None);
233237

234238
if let Err(err_count) = result {

0 commit comments

Comments
 (0)