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:
commit
25640092c7
|
@ -642,14 +642,14 @@ pub fn build_output_filenames(
|
||||||
);
|
);
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
if !sess.opts.cg.extra_filename.is_empty() {
|
||||||
|
sess.warn("ignoring -C extra-filename flag due to -o flag");
|
||||||
|
}
|
||||||
Some(out_file.clone())
|
Some(out_file.clone())
|
||||||
};
|
};
|
||||||
if *odir != None {
|
if *odir != None {
|
||||||
sess.warn("ignoring --out-dir flag due to -o flag");
|
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 {
|
OutputFilenames {
|
||||||
out_directory: out_file.parent().unwrap_or_else(|| Path::new("")).to_path_buf(),
|
out_directory: out_file.parent().unwrap_or_else(|| Path::new("")).to_path_buf(),
|
||||||
|
|
Loading…
Reference in New Issue