Warn that the name is ignored if a link target is emitted

This commit is contained in:
Kyle Aleshire 2017-01-04 18:23:19 -06:00 committed by
parent d40d01bd0e
commit 37829af09d

View File

@ -1335,9 +1335,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 output name requested with -o for \"link\" output because \
multiple outputs were requested");
None
} else {
Some(out_file.clone())