From 5576ce84cf13a32ebcf9a08366e3117da9832c84 Mon Sep 17 00:00:00 2001 From: varkor Date: Mon, 9 Apr 2018 16:37:32 +0100 Subject: [PATCH] Take OutputType::DepInfo into account for metadata_output_only --- src/librustc_metadata/encoder.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs index 3eefe68fb1fd9..767ab82aa34b4 100644 --- a/src/librustc_metadata/encoder.rs +++ b/src/librustc_metadata/encoder.rs @@ -28,7 +28,7 @@ use rustc::traits::specialization_graph; use rustc::ty::{self, Ty, TyCtxt, ReprOptions, SymbolName}; use rustc::ty::codec::{self as ty_codec, TyEncoder}; -use rustc::session::config::{self, CrateTypeProcMacro, OutputType}; +use rustc::session::config::{self, CrateTypeProcMacro}; use rustc::util::nodemap::FxHashMap; use rustc_data_structures::stable_hasher::StableHasher; @@ -835,8 +835,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> { fn metadata_output_only(&self) -> bool { // MIR optimisation can be skipped when we're just interested in the metadata. - self.tcx.sess.opts.output_types.len() == 1 && - self.tcx.sess.opts.output_types.contains_key(&OutputType::Metadata) + !self.tcx.sess.opts.output_types.should_trans() } fn encode_info_for_impl_item(&mut self, def_id: DefId) -> Entry<'tcx> {