Skip to content

Commit

Permalink
Auto merge of #49289 - varkor:emit-metadata-without-link, r=michaelwo…
Browse files Browse the repository at this point in the history
…erister

Make --emit=metadata output metadata regardless of link

Fixes #40109. I'm not sure whether this condition was important here or not, but I can't see why it is required (removing it doesn't cause the error the comment warns about, so I'm assuming it's safe). If this is too heavy-handed, I can special-case on `OutputType::Metadata`.

r? @nrc
  • Loading branch information
bors committed Apr 14, 2018
2 parents fb730d7 + 7575d96 commit cfc3465
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ pub(crate) fn link_binary(sess: &Session,
let mut out_filenames = Vec::new();
for &crate_type in sess.crate_types.borrow().iter() {
// Ignore executable crates if we have -Z no-trans, as they will error.
if (sess.opts.debugging_opts.no_trans ||
!sess.opts.output_types.should_trans()) &&
let output_metadata = sess.opts.output_types.contains_key(&OutputType::Metadata);
if (sess.opts.debugging_opts.no_trans || !sess.opts.output_types.should_trans()) &&
!output_metadata &&
crate_type == config::CrateTypeExecutable {
continue;
}
Expand Down

0 comments on commit cfc3465

Please sign in to comment.