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( Serialize , Deserialize ) ]
21
21
struct Diagnostic {
22
22
message : String ,
23
23
code : Option < DiagnosticCode > ,
@@ -27,7 +27,7 @@ struct Diagnostic {
27
27
rendered : Option < String > ,
28
28
}
29
29
30
- #[ derive( RustcEncodable , RustcDecodable , Clone ) ]
30
+ #[ derive( Serialize , Deserialize , Clone ) ]
31
31
struct DiagnosticSpan {
32
32
file_name : String ,
33
33
line_start : usize ,
@@ -40,7 +40,7 @@ struct DiagnosticSpan {
40
40
expansion : Option < Box < DiagnosticSpanMacroExpansion > > ,
41
41
}
42
42
43
- #[ derive( RustcEncodable , RustcDecodable , Clone ) ]
43
+ #[ derive( Serialize , Deserialize , Clone ) ]
44
44
struct DiagnosticSpanMacroExpansion {
45
45
/// span where macro was applied to generate this code
46
46
span : DiagnosticSpan ,
@@ -49,7 +49,7 @@ struct DiagnosticSpanMacroExpansion {
49
49
macro_decl_name : String ,
50
50
}
51
51
52
- #[ derive( RustcEncodable , RustcDecodable , Clone ) ]
52
+ #[ derive( Serialize , Deserialize , Clone ) ]
53
53
struct DiagnosticCode {
54
54
/// The code itself.
55
55
code : String ,
@@ -67,7 +67,7 @@ fn parse_line(file_name: &str, line: &str, output: &str, proc_res: &ProcRes) ->
67
67
// The compiler sometimes intermingles non-JSON stuff into the
68
68
// output. This hack just skips over such lines. Yuck.
69
69
if line. starts_with ( '{' ) {
70
- match json :: decode :: < Diagnostic > ( line) {
70
+ match serde_json :: from_str :: < Diagnostic > ( line) {
71
71
Ok ( diagnostic) => {
72
72
let mut expected_errors = vec ! [ ] ;
73
73
push_expected_errors ( & mut expected_errors, & diagnostic, & [ ] , file_name) ;
0 commit comments