Skip to content

Commit 7bc6468

Browse files
committed
Merge branch 'compiletest-update' of https://github.com/alexcrichton/rust into update-cargo
2 parents 8121db3 + db824b2 commit 7bc6468

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

src/tools/compiletest/Cargo.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ filetime = "0.1"
1010
getopts = "0.2"
1111
log = "0.4"
1212
regex = "0.2"
13-
rustc-serialize = "0.3"
13+
serde = "1.0"
14+
serde_json = "1.0"
15+
serde_derive = "1.0"
1416

1517
[target.'cfg(unix)'.dependencies]
1618
libc = "0.2"
1719

1820
[target.'cfg(windows)'.dependencies]
19-
miow = "0.2"
20-
winapi = "0.2"
21+
miow = "0.3"
22+
winapi = { version = "0.3", features = ["winerror"] }

src/tools/compiletest/src/json.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,24 @@
99
// except according to those terms.
1010

1111
use errors::{Error, ErrorKind};
12-
use rustc_serialize::json;
12+
use serde_json;
1313
use std::str::FromStr;
1414
use std::path::Path;
1515
use 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)]
2121
struct 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)]
3130
struct 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)]
4443
struct 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)]
5352
struct 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);

src/tools/compiletest/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ extern crate getopts;
2121
extern crate libc;
2222
#[macro_use]
2323
extern crate log;
24-
extern crate rustc_serialize;
2524
extern crate regex;
25+
#[macro_use]
26+
extern crate serde_derive;
27+
extern crate serde_json;
2628
extern crate test;
2729

2830
use std::env;

src/tools/compiletest/src/read2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ mod imp {
119119
use self::miow::iocp::{CompletionPort, CompletionStatus};
120120
use self::miow::pipe::NamedPipe;
121121
use self::miow::Overlapped;
122-
use self::winapi::ERROR_BROKEN_PIPE;
122+
use self::winapi::shared::winerror::ERROR_BROKEN_PIPE;
123123

124124
struct Pipe<'a> {
125125
dst: &'a mut Vec<u8>,

0 commit comments

Comments
 (0)