Skip to content

Commit 0981b98

Browse files
committed
compiletest: add support for unused extern notifications
As generated by --json unused-externs.
1 parent ff18038 commit 0981b98

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/tools/compiletest/src/json.rs

+11
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ struct ArtifactNotification {
2323
artifact: PathBuf,
2424
}
2525

26+
#[derive(Deserialize)]
27+
struct UnusedExternNotification {
28+
#[allow(dead_code)]
29+
lint_level: String,
30+
#[allow(dead_code)]
31+
unused_extern_names: Vec<String>,
32+
}
33+
2634
#[derive(Deserialize, Clone)]
2735
struct DiagnosticSpan {
2836
file_name: String,
@@ -113,6 +121,9 @@ pub fn extract_rendered(output: &str) -> String {
113121
} else if serde_json::from_str::<ArtifactNotification>(line).is_ok() {
114122
// Ignore the notification.
115123
None
124+
} else if serde_json::from_str::<UnusedExternNotification>(line).is_ok() {
125+
// Ignore the notification.
126+
None
116127
} else {
117128
print!(
118129
"failed to decode compiler output as json: line: {}\noutput: {}",

0 commit comments

Comments
 (0)