Skip to content

Commit

Permalink
Fix a bug in rust-lang#5152 that causes rustc/rustdoc to fail unneces…
Browse files Browse the repository at this point in the history
…sarily
  • Loading branch information
infinity0 committed Mar 15, 2018
1 parent 9895340 commit 3e07a3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/bin/commands/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
}
};
let mut compile_opts = args.compile_options_for_single_package(config, mode)?;
compile_opts.target_rustc_args = Some(values(args, "args"));
let target_args = values(args, "args");
compile_opts.target_rustc_args = if target_args.is_empty() {
None
} else {
Some(target_args)
};
ops::compile(&ws, &compile_opts)?;
Ok(())
}
7 changes: 6 additions & 1 deletion src/bin/commands/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
let ws = args.workspace(config)?;
let mut compile_opts =
args.compile_options_for_single_package(config, CompileMode::Doc { deps: false })?;
compile_opts.target_rustdoc_args = Some(values(args, "args"));
let target_args = values(args, "args");
compile_opts.target_rustdoc_args = if target_args.is_empty() {
None
} else {
Some(target_args)
};
let doc_opts = DocOptions {
open_result: args.is_present("open"),
compile_opts,
Expand Down

0 comments on commit 3e07a3e

Please sign in to comment.