Skip to content

Commit 63e4979

Browse files
committed
Remove all threading through of ErrorGuaranteed from the driver
It was inconsistently done (sometimes even within a single function) and most of the rest of the compiler uses fatal errors instead, which need to be caught using catch_with_exit_code anyway. Using fatal errors instead of ErrorGuaranteed everywhere in the driver simplifies things a bit.
1 parent 7cc19d7 commit 63e4979

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/driver.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ pub fn main() {
236236
let mut args: Vec<String> = orig_args.clone();
237237
pass_sysroot_env_if_given(&mut args, sys_root_env);
238238

239-
return rustc_driver::RunCompiler::new(&args, &mut DefaultCallbacks).run();
239+
rustc_driver::RunCompiler::new(&args, &mut DefaultCallbacks).run();
240+
return Ok(());
240241
}
241242

242243
if orig_args.iter().any(|a| a == "--version" || a == "-V") {
@@ -296,12 +297,13 @@ pub fn main() {
296297
args.extend(clippy_args);
297298
rustc_driver::RunCompiler::new(&args, &mut ClippyCallbacks { clippy_args_var })
298299
.set_using_internal_features(using_internal_features)
299-
.run()
300+
.run();
300301
} else {
301302
rustc_driver::RunCompiler::new(&args, &mut RustcCallbacks { clippy_args_var })
302303
.set_using_internal_features(using_internal_features)
303-
.run()
304+
.run();
304305
}
306+
return Ok(());
305307
}))
306308
}
307309

0 commit comments

Comments
 (0)