Make opts.maybe_sysroot non-optional

build_session_options always uses materialize_sysroot anyway.
This commit is contained in:
bjorn3
2025-03-07 16:55:28 +01:00
parent 57a4736e9f
commit b54398e4ea
9 changed files with 20 additions and 14 deletions
+4
View File
@@ -103,6 +103,8 @@ pub(crate) struct Options {
/// compiling doctests from the crate.
pub(crate) edition: Edition,
/// The path to the sysroot. Used during the compilation process.
pub(crate) sysroot: PathBuf,
/// Has the same value as `sysroot` except is `None` when the user didn't pass `---sysroot`.
pub(crate) maybe_sysroot: Option<PathBuf>,
/// Lint information passed over the command-line.
pub(crate) lint_opts: Vec<(String, Level)>,
@@ -202,6 +204,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
.field("unstable_options", &"...")
.field("target", &self.target)
.field("edition", &self.edition)
.field("sysroot", &self.sysroot)
.field("maybe_sysroot", &self.maybe_sysroot)
.field("lint_opts", &self.lint_opts)
.field("describe_lints", &self.describe_lints)
@@ -834,6 +837,7 @@ fn println_condition(condition: Condition) {
unstable_opts_strs,
target,
edition,
sysroot,
maybe_sysroot,
lint_opts,
describe_lints,
+2 -2
View File
@@ -210,7 +210,7 @@ pub(crate) fn create_config(
unstable_opts,
target,
edition,
maybe_sysroot,
sysroot,
lint_opts,
describe_lints,
lint_cap,
@@ -253,7 +253,7 @@ pub(crate) fn create_config(
let test = scrape_examples_options.map(|opts| opts.scrape_tests).unwrap_or(false);
// plays with error output here!
let sessopts = config::Options {
maybe_sysroot,
sysroot,
search_paths: libs,
crate_types,
lint_opts,
+1 -1
View File
@@ -158,7 +158,7 @@ pub(crate) fn run(dcx: DiagCtxtHandle<'_>, input: Input, options: RustdocOptions
if options.proc_macro_crate { vec![CrateType::ProcMacro] } else { vec![CrateType::Rlib] };
let sessopts = config::Options {
maybe_sysroot: options.maybe_sysroot.clone(),
sysroot: options.sysroot.clone(),
search_paths: options.libs.clone(),
crate_types,
lint_opts,