diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-03-28 11:43:35 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-03-28 11:43:35 +0000 |
| commit | c5c31447a7f2d8ffc03f058e3d39cff7627d3eb1 (patch) | |
| tree | 2d5c6406bafebf7bb2c34b27e89fe2ecc85a9ae8 /scripts/rustdoc-clif.rs | |
| parent | 22e4175bd63eb185b6a2a935386d1a52a6be1724 (diff) | |
Merge commit '09fae60a86b848a2fc0ad219ecc4e438dc1eef86' into sync_cg_clif-2024-03-28
Diffstat (limited to 'scripts/rustdoc-clif.rs')
| -rw-r--r-- | scripts/rustdoc-clif.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/rustdoc-clif.rs b/scripts/rustdoc-clif.rs index f7d1bdbc4c6..1cad312bb79 100644 --- a/scripts/rustdoc-clif.rs +++ b/scripts/rustdoc-clif.rs @@ -26,12 +26,18 @@ fn main() { codegen_backend_arg.push(cg_clif_dylib_path); args.push(codegen_backend_arg); } - if !passed_args.iter().any(|arg| { - arg == "--sysroot" || arg.to_str().is_some_and(|s| s.starts_with("--sysroot=")) - }) { + if !passed_args + .iter() + .any(|arg| arg == "--sysroot" || arg.to_str().is_some_and(|s| s.starts_with("--sysroot="))) + { args.push(OsString::from("--sysroot")); args.push(OsString::from(sysroot.to_str().unwrap())); } + if passed_args.is_empty() { + // Don't pass any arguments when the user didn't pass any arguments + // either to ensure the help message is shown. + args.clear(); + } args.extend(passed_args); let rustdoc = if let Some(rustdoc) = option_env!("RUSTDOC") { |
