Auto merge of #77649 - dash2507:replace_run_compiler, r=matthewjasper

Replace run_compiler with RunCompiler builder pattern

Fixes #77286. Replaces rustc_driver:run_compiler with RunCompiler builder pattern.
This commit is contained in:
bors 2020-10-11 01:26:06 +00:00
commit 25d2d09da7
3 changed files with 50 additions and 12 deletions

View file

@ -26,13 +26,8 @@ fn main() {
let mut count = 1;
let args = vec!["compiler-calls".to_string(), "foo.rs".to_string()];
rustc_driver::catch_fatal_errors(|| {
rustc_driver::run_compiler(
&args,
&mut TestCalls { count: &mut count },
None,
None,
None,
).ok();
}).ok();
rustc_driver::RunCompiler::new(&args, &mut TestCalls { count: &mut count }).run().ok();
})
.ok();
assert_eq!(count, 2);
}