Rollup merge of #103660 - ozkanonur:master, r=jyn514

improve `filesearch::get_or_default_sysroot`

`fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy.

Resolves https://github.com/rust-lang/rust/issues/98832

re-opened from #103581
This commit is contained in:
Dylan DPC
2022-11-05 11:31:28 +05:30
committed by GitHub
10 changed files with 152 additions and 255 deletions

View File

@@ -1309,7 +1309,7 @@ pub fn build_session(
let sysroot = match &sopts.maybe_sysroot {
Some(sysroot) => sysroot.clone(),
None => filesearch::get_or_default_sysroot(),
None => filesearch::get_or_default_sysroot().expect("Failed finding sysroot"),
};
let target_cfg = config::build_target_config(&sopts, target_override, &sysroot);