99// except according to those terms.
1010
1111use errors:: { Error , ErrorKind } ;
12- use rustc_serialize :: json ;
12+ use serde_json ;
1313use std:: str:: FromStr ;
1414use std:: path:: Path ;
1515use runtest:: ProcRes ;
1616
1717// These structs are a subset of the ones found in
1818// `syntax::json`.
1919
20- #[ derive( RustcEncodable , RustcDecodable ) ]
20+ #[ derive( Deserialize ) ]
2121struct Diagnostic {
2222 message : String ,
2323 code : Option < DiagnosticCode > ,
2424 level : String ,
2525 spans : Vec < DiagnosticSpan > ,
2626 children : Vec < Diagnostic > ,
27- rendered : Option < String > ,
2827}
2928
30- #[ derive( RustcEncodable , RustcDecodable , Clone ) ]
29+ #[ derive( Deserialize , Clone ) ]
3130struct DiagnosticSpan {
3231 file_name : String ,
3332 line_start : usize ,
@@ -40,7 +39,7 @@ struct DiagnosticSpan {
4039 expansion : Option < Box < DiagnosticSpanMacroExpansion > > ,
4140}
4241
43- #[ derive( RustcEncodable , RustcDecodable , Clone ) ]
42+ #[ derive( Deserialize , Clone ) ]
4443struct DiagnosticSpanMacroExpansion {
4544 /// span where macro was applied to generate this code
4645 span : DiagnosticSpan ,
@@ -49,7 +48,7 @@ struct DiagnosticSpanMacroExpansion {
4948 macro_decl_name : String ,
5049}
5150
52- #[ derive( RustcEncodable , RustcDecodable , Clone ) ]
51+ #[ derive( Deserialize , Clone ) ]
5352struct DiagnosticCode {
5453 /// The code itself.
5554 code : String ,
@@ -67,7 +66,7 @@ fn parse_line(file_name: &str, line: &str, output: &str, proc_res: &ProcRes) ->
6766 // The compiler sometimes intermingles non-JSON stuff into the
6867 // output. This hack just skips over such lines. Yuck.
6968 if line. starts_with ( '{' ) {
70- match json :: decode :: < Diagnostic > ( line) {
69+ match serde_json :: from_str :: < Diagnostic > ( line) {
7170 Ok ( diagnostic) => {
7271 let mut expected_errors = vec ! [ ] ;
7372 push_expected_errors ( & mut expected_errors, & diagnostic, & [ ] , file_name) ;
0 commit comments