about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/interface.rs
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2024-02-15 00:03:34 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2024-02-15 00:09:40 +0000
commit5441523f0727639040fdd134abff1e298d88733e (patch)
treefd0f7221cd0d370537d0a017280fadbc152a4d48 /compiler/rustc_interface/src/interface.rs
parenta03d19ef63d342c408d7ec8208bda5b4eb0bacf5 (diff)
downloadrust-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.rs5
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 => {