]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/compiletest/src/json.rs
Auto merge of #61008 - GuillaumeGomez:fix-rustdoc-code-highlighting, r=Manishearth
[rust.git] / src / tools / compiletest / src / json.rs
index 26a3c4dee40aa478f3ec112f56187d167b59c34b..02b09e21ff0226e5bf9d3c27a80eecba9d0980ef 100644 (file)
@@ -3,8 +3,9 @@
 
 use crate::errors::{Error, ErrorKind};
 use crate::runtest::ProcRes;
+use serde::Deserialize;
 use serde_json;
-use std::path::Path;
+use std::path::{Path, PathBuf};
 use std::str::FromStr;
 
 #[derive(Deserialize)]
@@ -18,9 +19,9 @@ struct Diagnostic {
 }
 
 #[derive(Deserialize)]
-struct Directive {
+struct ArtifactNotification {
     #[allow(dead_code)]
-    directive: String,
+    artifact: PathBuf,
 }
 
 #[derive(Deserialize, Clone)]
@@ -75,8 +76,8 @@ pub fn extract_rendered(output: &str) -> String {
             if line.starts_with('{') {
                 if let Ok(diagnostic) = serde_json::from_str::<Diagnostic>(line) {
                     diagnostic.rendered
-                } else if let Ok(_directive) = serde_json::from_str::<Directive>(line) {
-                    // Swallow the directive.
+                } else if let Ok(_) = serde_json::from_str::<ArtifactNotification>(line) {
+                    // Ignore the notification.
                     None
                 } else {
                     print!(