diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2018-01-22 18:18:40 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2018-01-22 18:19:41 +0100 |
| commit | c3fabceab15442b2d4a13774cb07019bc7ec5bc5 (patch) | |
| tree | d7109c48acbc86a0d14a580d0a4388b34e3dbff4 /src/librustc_driver/lib.rs | |
| parent | fdc18b3067b5bad257ccbe7400e3c4fb617e9e18 (diff) | |
| download | rust-c3fabceab15442b2d4a13774cb07019bc7ec5bc5.tar.gz rust-c3fabceab15442b2d4a13774cb07019bc7ec5bc5.zip | |
Inline some rustc_driver function
Diffstat (limited to 'src/librustc_driver/lib.rs')
| -rw-r--r-- | src/librustc_driver/lib.rs | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index de5559c8b14..c05004d1c15 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -669,7 +669,7 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls { control.after_hir_lowering.stop = Compilation::Stop; } - if save_analysis(sess) { + if sess.opts.debugging_opts.save_analysis { enable_save_analysis(&mut control); } @@ -704,10 +704,6 @@ pub fn enable_save_analysis(control: &mut CompileController) { control.make_glob_map = resolve::MakeGlobMap::Yes; } -fn save_analysis(sess: &Session) -> bool { - sess.opts.debugging_opts.save_analysis -} - impl RustcDefaultCalls { pub fn list_metadata(sess: &Session, cstore: &CrateStore, @@ -1329,20 +1325,19 @@ pub fn diagnostics_registry() -> errors::registry::Registry { Registry::new(&all_errors) } -pub fn get_args() -> Vec<String> { - env::args_os().enumerate() - .map(|(i, arg)| arg.into_string().unwrap_or_else(|arg| { - early_error(ErrorOutputType::default(), - &format!("Argument {} is not valid Unicode: {:?}", i, arg)) - })) - .collect() -} - pub fn main() { env_logger::init().unwrap(); - let result = run(|| run_compiler(&get_args(), - &mut RustcDefaultCalls, - None, - None)); + let result = run(|| { + let args = env::args_os().enumerate() + .map(|(i, arg)| arg.into_string().unwrap_or_else(|arg| { + early_error(ErrorOutputType::default(), + &format!("Argument {} is not valid Unicode: {:?}", i, arg)) + })) + .collect::<Vec<_>>(); + run_compiler(&args, + &mut RustcDefaultCalls, + None, + None) + }); process::exit(result as i32); } |
