diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2024-02-15 00:03:34 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2024-02-15 00:09:40 +0000 |
| commit | 5441523f0727639040fdd134abff1e298d88733e (patch) | |
| tree | fd0f7221cd0d370537d0a017280fadbc152a4d48 /compiler/rustc_interface/src/interface.rs | |
| parent | a03d19ef63d342c408d7ec8208bda5b4eb0bacf5 (diff) | |
| download | rust-5441523f0727639040fdd134abff1e298d88733e.tar.gz rust-5441523f0727639040fdd134abff1e298d88733e.zip | |
Refactor out a repeating pattern with `get_or_default_sysroot`
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index f53b320f2e0..a45762b2ce7 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -336,10 +336,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se let early_dcx = EarlyDiagCtxt::new(config.opts.error_format); - let sysroot = match &config.opts.maybe_sysroot { - Some(sysroot) => sysroot.clone(), - None => filesearch::get_or_default_sysroot().expect("Failed finding sysroot"), - }; + let sysroot = filesearch::materialize_sysroot(config.opts.maybe_sysroot.clone()); let (codegen_backend, target_cfg) = match config.make_codegen_backend { None => { |
