Skip to content

Commit 911a9b0

Browse files
committed
Always emit rmeta when timings are enable to visualize codegen everywhere.
1 parent 8bfae2d commit 911a9b0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/cargo/core/compiler/job_queue.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ impl<'a> JobState<'a> {
121121
/// This should only be called once because a metadata file can only be
122122
/// produced once!
123123
pub fn rmeta_produced(&self) {
124-
assert!(self.rmeta_required.get());
125124
self.rmeta_required.set(false);
126125
let _ = self
127126
.tx

src/cargo/core/compiler/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,10 +698,11 @@ 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-
if cx.bcx.build_config.cache_messages() || pipelined {
701+
let wants_artifacts = pipelined || cx.bcx.config.cli_unstable().timings.is_some();
702+
if cx.bcx.build_config.cache_messages() || wants_artifacts {
702703
cmd.arg("--error-format=json");
703704
let mut json = String::from("--json=diagnostic-rendered-ansi");
704-
if pipelined {
705+
if wants_artifacts {
705706
json.push_str(",artifacts");
706707
}
707708
match cx.bcx.build_config.message_format {
@@ -1075,7 +1076,8 @@ struct OutputOptions {
10751076

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

0 commit comments

Comments
 (0)