mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
Replace run_compiler with RunCompiler builder pattern.
RunCompiler::new takes non-optional params, and optional params can be set using set_*field_name* method. finally `run` will forward all fields to `run_compiler`.
This commit is contained in:
parent
adb7fc6283
commit
1385eb9b55
@ -357,7 +357,7 @@ pub fn main() {
|
||||
args.extend(vec!["--sysroot".into(), sys_root]);
|
||||
};
|
||||
|
||||
return rustc_driver::run_compiler(&args, &mut DefaultCallbacks, None, None, None);
|
||||
return rustc_driver::RunCompiler::new(&args, &mut DefaultCallbacks).run();
|
||||
}
|
||||
|
||||
if orig_args.iter().any(|a| a == "--version" || a == "-V") {
|
||||
@ -420,6 +420,6 @@ pub fn main() {
|
||||
let mut default = DefaultCallbacks;
|
||||
let callbacks: &mut (dyn rustc_driver::Callbacks + Send) =
|
||||
if clippy_enabled { &mut clippy } else { &mut default };
|
||||
rustc_driver::run_compiler(&args, callbacks, None, None, None)
|
||||
rustc_driver::RunCompiler::new(&args, callbacks).run()
|
||||
}))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user