]> git.lizzy.rs Git - rust.git/blob - clippy_dev/src/lint.rs
Auto merge of #8250 - pr2502:fix_repeat_underflow, r=giraffate
[rust.git] / clippy_dev / src / lint.rs
1 use std::process::{self, Command};
2
3 pub fn run(filename: &str) {
4     let code = Command::new("cargo")
5         .args(["run", "--bin", "clippy-driver", "--"])
6         .args(["-L", "./target/debug"])
7         .args(["-Z", "no-codegen"])
8         .args(["--edition", "2021"])
9         .arg(filename)
10         .status()
11         .expect("failed to run cargo")
12         .code();
13
14     if code.is_none() {
15         eprintln!("Killed by signal");
16     }
17
18     process::exit(code.unwrap_or(1));
19 }