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!
This commit is contained in:
bors 2017-01-09 04:57:36 +00:00
commit f5cfe83da9

View file

@ -1334,9 +1334,10 @@ pub fn build_output_filenames(input: &Input,
.values()
.filter(|a| a.is_none())
.count();
let ofile = if unnamed_output_types > 1 {
sess.warn("ignoring specified output filename because multiple outputs were \
requested");
let ofile = if unnamed_output_types > 1 &&
sess.opts.output_types.contains_key(&OutputType::Exe) {
sess.warn("ignoring specified output filename for 'link' output because multiple \
outputs were requested");
None
} else {
Some(out_file.clone())