Skip to content

Commit 04c060c

Browse files
committed
Fix a bug in rust-lang#5152 that causes rustc/rustdoc to fail unnecessarily
1 parent 57aab39 commit 04c060c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/bin/commands/rustc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
6262
let mut compile_opts = args.compile_options_for_single_package(
6363
config, mode,
6464
)?;
65-
compile_opts.target_rustc_args = Some(values(args, "args"));
65+
let target_args = values(args, "args");
66+
compile_opts.target_rustc_args = if target_args.is_empty() { None } else { Some(target_args) };
6667
ops::compile(&ws, &compile_opts)?;
6768
Ok(())
6869
}

src/bin/commands/rustdoc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
4545
let mut compile_opts = args.compile_options_for_single_package(
4646
config, CompileMode::Doc { deps: false },
4747
)?;
48-
compile_opts.target_rustdoc_args = Some(values(args, "args"));
48+
let target_args = values(args, "args");
49+
compile_opts.target_rustdoc_args = if target_args.is_empty() { None } else { Some(target_args) };
4950
let doc_opts = DocOptions {
5051
open_result: args.is_present("open"),
5152
compile_opts,

0 commit comments

Comments
 (0)