Skip to content

Warn that the link target ignores the given name #38840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could change the error message less - in particular, keeping filename rather than name seems more informative, and I don't think mentioning -o is necessary. Nit: I would prefer using single quotes or backticks rather than double quotes around link.

Copy link
Contributor Author

@kjaleshire kjaleshire Jan 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I just copied the message suggested in the issue comments.

multiple outputs were requested");
None
} else {
Some(out_file.clone())
Expand Down