Skip to content

Commit e913efe

Browse files
committed
Move timings check to rmeta_required.
1 parent aae1416 commit e913efe

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/cargo/core/compiler/context/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
513513
/// Returns whether when `unit` is built whether it should emit metadata as
514514
/// well because some compilations rely on that.
515515
pub fn rmeta_required(&self, unit: &Unit<'a>) -> bool {
516-
self.rmeta_required.contains(unit)
516+
self.rmeta_required.contains(unit) || self.bcx.config.cli_unstable().timings.is_some()
517517
}
518518
}

src/cargo/core/compiler/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,11 +698,10 @@ fn add_error_format_and_color(
698698
// prettily, and then when parsing JSON messages from rustc we need to
699699
// internally understand that we should extract the `rendered` field and
700700
// present it if we can.
701-
let wants_artifacts = pipelined || cx.bcx.config.cli_unstable().timings.is_some();
702-
if cx.bcx.build_config.cache_messages() || wants_artifacts {
701+
if cx.bcx.build_config.cache_messages() || pipelined {
703702
cmd.arg("--error-format=json");
704703
let mut json = String::from("--json=diagnostic-rendered-ansi");
705-
if wants_artifacts {
704+
if pipelined {
706705
json.push_str(",artifacts");
707706
}
708707
match cx.bcx.build_config.message_format {
@@ -1076,8 +1075,7 @@ struct OutputOptions {
10761075

10771076
impl OutputOptions {
10781077
fn new<'a>(cx: &Context<'a, '_>, unit: &Unit<'a>) -> OutputOptions {
1079-
let look_for_metadata_directive =
1080-
cx.rmeta_required(unit) || cx.bcx.config.cli_unstable().timings.is_some();
1078+
let look_for_metadata_directive = cx.rmeta_required(unit);
10811079
let color = cx.bcx.config.shell().supports_color();
10821080
let cache_cell = if cx.bcx.build_config.cache_messages() {
10831081
let path = cx.files().message_cache_path(unit);

0 commit comments

Comments
 (0)