mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
compiletest: add support for unused extern notifications
As generated by --json unused-externs.
This commit is contained in:
parent
ff18038d75
commit
0981b9857e
@ -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<String>,
|
||||
}
|
||||
|
||||
#[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::<ArtifactNotification>(line).is_ok() {
|
||||
// Ignore the notification.
|
||||
None
|
||||
} else if serde_json::from_str::<UnusedExternNotification>(line).is_ok() {
|
||||
// Ignore the notification.
|
||||
None
|
||||
} else {
|
||||
print!(
|
||||
"failed to decode compiler output as json: line: {}\noutput: {}",
|
||||
|
Loading…
Reference in New Issue
Block a user