Rollup merge of #62128 - ehuss:extra-filename-warning, r=matthewjasper

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.
This commit is contained in:
Mark Rousskov 2019-07-03 09:59:13 -04:00 committed by GitHub
commit 25640092c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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(),