diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-10-18 15:28:23 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-10-30 20:02:14 -0400 |
| commit | 6bdb4e32067a37b339d77f7788a772356d486f72 (patch) | |
| tree | 6d8df8adc0d41c747e5967f3dcc0adbe588640a6 /src/tools/compiletest | |
| parent | 23018a55d9735afbefb19fcec91db4b53fe917d8 (diff) | |
Some work
Diffstat (limited to 'src/tools/compiletest')
| -rw-r--r-- | src/tools/compiletest/src/json.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/json.rs b/src/tools/compiletest/src/json.rs index 6a03a76c566..643475dc539 100644 --- a/src/tools/compiletest/src/json.rs +++ b/src/tools/compiletest/src/json.rs @@ -36,6 +36,17 @@ struct DiagnosticSpan { expansion: Option<Box<DiagnosticSpanMacroExpansion>>, } +#[derive(Deserialize)] +struct FutureIncompatReport { + future_incompat_report: Vec<FutureBreakageItem> +} + +#[derive(Deserialize)] +struct FutureBreakageItem { + future_breakage_date: Option<String>, + diagnostic: Diagnostic +} + impl DiagnosticSpan { /// Returns the deepest source span in the macro call stack with a given file name. /// This is either the supplied span, or the span for some macro callsite that expanded to it. @@ -94,10 +105,14 @@ pub fn extract_rendered(output: &str) -> String { } pub fn parse_output(file_name: &str, output: &str, proc_res: &ProcRes) -> Vec<Error> { - output.lines().flat_map(|line| parse_line(file_name, line, output, proc_res)).collect() + let lines = output.lines(); + let last_line = lines.next_back(); + lines.flat_map(|line| parse_line(file_name, line, output, proc_res, false)).chain( + last_line.into_iter().flat_map(|line| parse_line(file_name, line, output, proc_res, true)) + ).collect() } -fn parse_line(file_name: &str, line: &str, output: &str, proc_res: &ProcRes) -> Vec<Error> { +fn parse_line(file_name: &str, line: &str, output: &str, proc_res: &ProcRes, last_line: bool) -> Vec<Error> { // The compiler sometimes intermingles non-JSON stuff into the // output. This hack just skips over such lines. Yuck. if line.starts_with('{') { |
