Skip to content

Commit cfc3465

Browse files
committed
Auto merge of #49289 - varkor:emit-metadata-without-link, r=michaelwoerister
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
2 parents fb730d7 + 7575d96 commit cfc3465

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_trans/back/link.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ pub(crate) fn link_binary(sess: &Session,
149149
let mut out_filenames = Vec::new();
150150
for &crate_type in sess.crate_types.borrow().iter() {
151151
// Ignore executable crates if we have -Z no-trans, as they will error.
152-
if (sess.opts.debugging_opts.no_trans ||
153-
!sess.opts.output_types.should_trans()) &&
152+
let output_metadata = sess.opts.output_types.contains_key(&OutputType::Metadata);
153+
if (sess.opts.debugging_opts.no_trans || !sess.opts.output_types.should_trans()) &&
154+
!output_metadata &&
154155
crate_type == config::CrateTypeExecutable {
155156
continue;
156157
}

0 commit comments

Comments
 (0)