summaryrefslogtreecommitdiffstats
path: root/src/bootstrap/bin/rustdoc.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/bootstrap/bin/rustdoc.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/bootstrap/bin/rustdoc.rs')
-rw-r--r--src/bootstrap/bin/rustdoc.rs19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
index 4ecb33498..6561c1c19 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
@@ -9,14 +9,14 @@ use std::process::{exit, Command};
include!("../dylib_util.rs");
+include!("./_helper.rs");
+
fn main() {
let args = env::args_os().skip(1).collect::<Vec<_>>();
- let stage = env::var("RUSTC_STAGE").unwrap_or_else(|_| {
- // Don't panic here; it's reasonable to try and run these shims directly. Give a helpful error instead.
- eprintln!("rustc shim: fatal: RUSTC_STAGE was not set");
- eprintln!("rustc shim: note: use `x.py build -vvv` to see all environment variables set by bootstrap");
- exit(101);
- });
+
+ let stage = parse_rustc_stage();
+ let verbose = parse_rustc_verbose();
+
let rustdoc = env::var_os("RUSTDOC_REAL").expect("RUSTDOC_REAL was not set");
let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set");
let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
@@ -25,13 +25,6 @@ fn main() {
// is passed (a bit janky...)
let target = args.windows(2).find(|w| &*w[0] == "--target").and_then(|w| w[1].to_str());
- use std::str::FromStr;
-
- let verbose = match env::var("RUSTC_VERBOSE") {
- Ok(s) => usize::from_str(&s).expect("RUSTC_VERBOSE should be an integer"),
- Err(_) => 0,
- };
-
let mut dylib_path = dylib_path();
dylib_path.insert(0, PathBuf::from(libdir.clone()));