Skip to content

Commit

Permalink
Rollup merge of rust-lang#62128 - ehuss:extra-filename-warning, r=mat…
Browse files Browse the repository at this point in the history
…thewjasper

Adjust warning of -C extra-filename with -o.

If `--emit` includes multiple unnamed outputs, and `-o` was specified, and `-C extra-filename` was specified, the compiler would warn that `-C extra-filename` was ignored, but this is not true.  The "adapting" of the filenames includes the extra-filename info.

Since this is a little convoluted and hard to follow, here is a little chart to summarize when running with `rustc foo.rs -o xyz -C extra-filename=asdf`

`--emit` | Result
---------|--------
`link` | `xyz` (extra-filename ignored)
`link,dep-info` | `xyzasdf`, `xyzasdf.d` (this PR removes the incorrect warning)

As to whether or not this behavior is the best choice is another question.
  • Loading branch information
Mark-Simulacrum authored Jul 3, 2019
2 parents 619df2e + 9d798b7 commit 2564009
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_interface/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,14 +642,14 @@ pub fn build_output_filenames(
);
None
} else {
if !sess.opts.cg.extra_filename.is_empty() {
sess.warn("ignoring -C extra-filename flag due to -o flag");
}
Some(out_file.clone())
};
if *odir != None {
sess.warn("ignoring --out-dir flag due to -o flag");
}
if !sess.opts.cg.extra_filename.is_empty() {
sess.warn("ignoring -C extra-filename flag due to -o flag");
}

OutputFilenames {
out_directory: out_file.parent().unwrap_or_else(|| Path::new("")).to_path_buf(),
Expand Down

0 comments on commit 2564009

Please sign in to comment.