9
9
// except according to those terms.
10
10
11
11
use errors:: { Error , ErrorKind } ;
12
- use rustc_serialize :: json ;
12
+ use serde_json ;
13
13
use std:: str:: FromStr ;
14
14
use std:: path:: Path ;
15
15
use runtest:: ProcRes ;
16
16
17
17
// These structs are a subset of the ones found in
18
18
// `syntax::json`.
19
19
20
- #[ derive( RustcEncodable , RustcDecodable ) ]
20
+ #[ derive( Deserialize ) ]
21
21
struct Diagnostic {
22
22
message : String ,
23
23
code : Option < DiagnosticCode > ,
24
24
level : String ,
25
25
spans : Vec < DiagnosticSpan > ,
26
26
children : Vec < Diagnostic > ,
27
- rendered : Option < String > ,
28
27
}
29
28
30
- #[ derive( RustcEncodable , RustcDecodable , Clone ) ]
29
+ #[ derive( Deserialize , Clone ) ]
31
30
struct DiagnosticSpan {
32
31
file_name : String ,
33
32
line_start : usize ,
@@ -40,7 +39,7 @@ struct DiagnosticSpan {
40
39
expansion : Option < Box < DiagnosticSpanMacroExpansion > > ,
41
40
}
42
41
43
- #[ derive( RustcEncodable , RustcDecodable , Clone ) ]
42
+ #[ derive( Deserialize , Clone ) ]
44
43
struct DiagnosticSpanMacroExpansion {
45
44
/// span where macro was applied to generate this code
46
45
span : DiagnosticSpan ,
@@ -49,7 +48,7 @@ struct DiagnosticSpanMacroExpansion {
49
48
macro_decl_name : String ,
50
49
}
51
50
52
- #[ derive( RustcEncodable , RustcDecodable , Clone ) ]
51
+ #[ derive( Deserialize , Clone ) ]
53
52
struct DiagnosticCode {
54
53
/// The code itself.
55
54
code : String ,
@@ -67,7 +66,7 @@ fn parse_line(file_name: &str, line: &str, output: &str, proc_res: &ProcRes) ->
67
66
// The compiler sometimes intermingles non-JSON stuff into the
68
67
// output. This hack just skips over such lines. Yuck.
69
68
if line. starts_with ( '{' ) {
70
- match json :: decode :: < Diagnostic > ( line) {
69
+ match serde_json :: from_str :: < Diagnostic > ( line) {
71
70
Ok ( diagnostic) => {
72
71
let mut expected_errors = vec ! [ ] ;
73
72
push_expected_errors ( & mut expected_errors, & diagnostic, & [ ] , file_name) ;
0 commit comments