From c971d4a1809cdbe346c9c3e005ec12306341e512 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 4 Mar 2024 09:07:02 +0100 Subject: [PATCH] Make use of sysroot in librustdoc/config.rs for builtin:$path --- src/librustdoc/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 0bd9fffae6dd..44c61c9815fb 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -617,11 +617,12 @@ impl Options { } let target = parse_target_triple(early_dcx, matches); + let maybe_sysroot = matches.opt_str("sysroot").map(PathBuf::from); let libs = matches .opt_strs("L") .iter() - .map(|s| SearchPath::from_cli_opt(None, &target, early_dcx, s)) + .map(|s| SearchPath::from_cli_opt(Some(&maybe_sysroot), &target, early_dcx, s)) .collect(); let show_coverage = matches.opt_present("show-coverage"); @@ -651,7 +652,6 @@ impl Options { let bin_crate = crate_types.contains(&CrateType::Executable); let proc_macro_crate = crate_types.contains(&CrateType::ProcMacro); let playground_url = matches.opt_str("playground-url"); - let maybe_sysroot = matches.opt_str("sysroot").map(PathBuf::from); let module_sorting = if matches.opt_present("sort-modules-by-appearance") { ModuleSorting::DeclarationOrder } else {