Skip to content

Commit 8056506

Browse files
committed
Special-case OutputType::Metadata
1 parent 2a5f3ee commit 8056506

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc_trans/back/link.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ pub(crate) fn link_binary(sess: &Session,
146146
let mut out_filenames = Vec::new();
147147
for &crate_type in sess.crate_types.borrow().iter() {
148148
// Ignore executable crates if we have -Z no-trans, as they will error.
149-
if sess.opts.debugging_opts.no_trans && crate_type == config::CrateTypeExecutable {
149+
let output_metadata = sess.opts.output_types.contains_key(&OutputType::Metadata);
150+
let ignore_executable = sess.opts.debugging_opts.no_trans ||
151+
!(sess.opts.output_types.should_trans() || output_metadata);
152+
if crate_type == config::CrateTypeExecutable && ignore_executable {
150153
continue;
151154
}
152155

0 commit comments

Comments
 (0)