Always emit rmeta when timings are enable to visualize codegen everywhere.

This commit is contained in:
Eric Huss 2019-09-14 16:18:58 -07:00
parent 8bfae2d999
commit 911a9b0904
2 changed files with 5 additions and 4 deletions

View File

@ -121,7 +121,6 @@ impl<'a> JobState<'a> {
/// This should only be called once because a metadata file can only be
/// produced once!
pub fn rmeta_produced(&self) {
assert!(self.rmeta_required.get());
self.rmeta_required.set(false);
let _ = self
.tx

View File

@ -698,10 +698,11 @@ 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.
if cx.bcx.build_config.cache_messages() || pipelined {
let wants_artifacts = pipelined || cx.bcx.config.cli_unstable().timings.is_some();
if cx.bcx.build_config.cache_messages() || wants_artifacts {
cmd.arg("--error-format=json");
let mut json = String::from("--json=diagnostic-rendered-ansi");
if pipelined {
if wants_artifacts {
json.push_str(",artifacts");
}
match cx.bcx.build_config.message_format {
@ -1075,7 +1076,8 @@ struct OutputOptions {
impl OutputOptions {
fn new<'a>(cx: &Context<'a, '_>, unit: &Unit<'a>) -> OutputOptions {
let look_for_metadata_directive = cx.rmeta_required(unit);
let look_for_metadata_directive =
cx.rmeta_required(unit) || cx.bcx.config.cli_unstable().timings.is_some();
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);