Skip to content

Commit

Permalink
Move timings check to rmeta_required.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Sep 17, 2019
1 parent aae1416 commit e913efe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
/// Returns whether when `unit` is built whether it should emit metadata as
/// well because some compilations rely on that.
pub fn rmeta_required(&self, unit: &Unit<'a>) -> bool {
self.rmeta_required.contains(unit)
self.rmeta_required.contains(unit) || self.bcx.config.cli_unstable().timings.is_some()
}
}
8 changes: 3 additions & 5 deletions src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,11 +698,10 @@ fn add_error_format_and_color(
// prettily, and then when parsing JSON messages from rustc we need to
// internally understand that we should extract the `rendered` field and
// present it if we can.
let wants_artifacts = pipelined || cx.bcx.config.cli_unstable().timings.is_some();
if cx.bcx.build_config.cache_messages() || wants_artifacts {
if cx.bcx.build_config.cache_messages() || pipelined {
cmd.arg("--error-format=json");
let mut json = String::from("--json=diagnostic-rendered-ansi");
if wants_artifacts {
if pipelined {
json.push_str(",artifacts");
}
match cx.bcx.build_config.message_format {
Expand Down Expand Up @@ -1076,8 +1075,7 @@ struct OutputOptions {

impl OutputOptions {
fn new<'a>(cx: &Context<'a, '_>, unit: &Unit<'a>) -> OutputOptions {
let look_for_metadata_directive =
cx.rmeta_required(unit) || cx.bcx.config.cli_unstable().timings.is_some();
let look_for_metadata_directive = cx.rmeta_required(unit);
let color = cx.bcx.config.shell().supports_color();
let cache_cell = if cx.bcx.build_config.cache_messages() {
let path = cx.files().message_cache_path(unit);
Expand Down

0 comments on commit e913efe

Please sign in to comment.