mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
rustc_driver: factor out computing the exit code
This commit is contained in:
parent
51158cc71f
commit
30822733f0
1 changed files with 1 additions and 3 deletions
|
@ -296,7 +296,7 @@ pub fn main() {
|
||||||
rustc_driver::init_rustc_env_logger();
|
rustc_driver::init_rustc_env_logger();
|
||||||
lazy_static::initialize(&ICE_HOOK);
|
lazy_static::initialize(&ICE_HOOK);
|
||||||
exit(
|
exit(
|
||||||
rustc_driver::catch_fatal_errors(move || {
|
rustc_driver::catch_with_exit_code(move || {
|
||||||
let mut orig_args: Vec<String> = env::args().collect();
|
let mut orig_args: Vec<String> = env::args().collect();
|
||||||
|
|
||||||
if orig_args.iter().any(|a| a == "--version" || a == "-V") {
|
if orig_args.iter().any(|a| a == "--version" || a == "-V") {
|
||||||
|
@ -411,7 +411,5 @@ pub fn main() {
|
||||||
if clippy_enabled { &mut clippy } else { &mut default };
|
if clippy_enabled { &mut clippy } else { &mut default };
|
||||||
rustc_driver::run_compiler(&args, callbacks, None, None)
|
rustc_driver::run_compiler(&args, callbacks, None, None)
|
||||||
})
|
})
|
||||||
.and_then(|result| result)
|
|
||||||
.is_err() as i32,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue