Skip to content

Commit 2564009

Browse files
Rollup merge of rust-lang#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.
2 parents 619df2e + 9d798b7 commit 2564009

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_interface/util.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -642,14 +642,14 @@ pub fn build_output_filenames(
642642
);
643643
None
644644
} else {
645+
if !sess.opts.cg.extra_filename.is_empty() {
646+
sess.warn("ignoring -C extra-filename flag due to -o flag");
647+
}
645648
Some(out_file.clone())
646649
};
647650
if *odir != None {
648651
sess.warn("ignoring --out-dir flag due to -o flag");
649652
}
650-
if !sess.opts.cg.extra_filename.is_empty() {
651-
sess.warn("ignoring -C extra-filename flag due to -o flag");
652-
}
653653

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

0 commit comments

Comments
 (0)