Skip to content

Commit f5cfe83

Browse files
committed
Auto merge of #38840 - kjaleshire:multiple-targets-error-fix, r=nrc
Warn that the link target ignores the given name Hi, new contributor here. This is my stab at #20130, any feedback welcome!
2 parents aee21e2 + 4af830a commit f5cfe83

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_driver/driver.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1334,9 +1334,10 @@ pub fn build_output_filenames(input: &Input,
13341334
.values()
13351335
.filter(|a| a.is_none())
13361336
.count();
1337-
let ofile = if unnamed_output_types > 1 {
1338-
sess.warn("ignoring specified output filename because multiple outputs were \
1339-
requested");
1337+
let ofile = if unnamed_output_types > 1 &&
1338+
sess.opts.output_types.contains_key(&OutputType::Exe) {
1339+
sess.warn("ignoring specified output filename for 'link' output because multiple \
1340+
outputs were requested");
13401341
None
13411342
} else {
13421343
Some(out_file.clone())

0 commit comments

Comments
 (0)