From 0981b9857ed9a4c840221b089fc5103373c8595f Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Fri, 15 Apr 2022 10:46:58 -0700 Subject: [PATCH] compiletest: add support for unused extern notifications As generated by --json unused-externs. --- src/tools/compiletest/src/json.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tools/compiletest/src/json.rs b/src/tools/compiletest/src/json.rs index a5ff779a4ab..10726b98420 100644 --- a/src/tools/compiletest/src/json.rs +++ b/src/tools/compiletest/src/json.rs @@ -23,6 +23,14 @@ struct ArtifactNotification { artifact: PathBuf, } +#[derive(Deserialize)] +struct UnusedExternNotification { + #[allow(dead_code)] + lint_level: String, + #[allow(dead_code)] + unused_extern_names: Vec, +} + #[derive(Deserialize, Clone)] struct DiagnosticSpan { file_name: String, @@ -113,6 +121,9 @@ pub fn extract_rendered(output: &str) -> String { } else if serde_json::from_str::(line).is_ok() { // Ignore the notification. None + } else if serde_json::from_str::(line).is_ok() { + // Ignore the notification. + None } else { print!( "failed to decode compiler output as json: line: {}\noutput: {}",