Skip to content

Commit 81ac104

Browse files
committed
Start using serde_derive in a couple places in the compiler.
1 parent 9abc231 commit 81ac104

File tree

8 files changed

+31
-2
lines changed

8 files changed

+31
-2
lines changed

Cargo.lock

+5
Original file line numberDiff line numberDiff line change
@@ -2223,6 +2223,7 @@ version = "0.0.0"
22232223
dependencies = [
22242224
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
22252225
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
2226+
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
22262227
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
22272228
]
22282229

@@ -2288,6 +2289,8 @@ dependencies = [
22882289
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
22892290
"rustc_cratesio_shim 0.0.0",
22902291
"rustc_data_structures 0.0.0",
2292+
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
2293+
"serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
22912294
"serialize 0.0.0",
22922295
"syntax_pos 0.0.0",
22932296
"termcolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2901,6 +2904,8 @@ dependencies = [
29012904
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
29022905
"rustc_data_structures 0.0.0",
29032906
"scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
2907+
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
2908+
"serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
29042909
"serialize 0.0.0",
29052910
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
29062911
]

src/librustc_cratesio_shim/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ crate-type = ["dylib"]
2222
[dependencies]
2323
bitflags = "1.0"
2424
log = "0.4"
25+
serde = "1.0"
2526
unicode-width = "0.1.4"

src/librustc_cratesio_shim/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
extern crate bitflags;
1717
extern crate log;
1818
extern crate proc_macro;
19+
extern crate serde;
1920
extern crate unicode_width;

src/librustc_errors/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ serialize = { path = "../libserialize" }
1414
syntax_pos = { path = "../libsyntax_pos" }
1515
rustc_data_structures = { path = "../librustc_data_structures" }
1616
rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
17+
serde = "1.0"
18+
serde_derive = "1.0"
1719
unicode-width = "0.1.4"
1820
atty = "0.2"
1921
termcolor = "1.0"

src/librustc_errors/lib.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ extern crate libc;
2626
#[macro_use]
2727
extern crate log;
2828
extern crate rustc_data_structures;
29+
#[macro_use]
30+
extern crate serde_derive;
31+
extern crate serde;
2932
extern crate serialize as rustc_serialize;
3033
extern crate syntax_pos;
3134
extern crate unicode_width;
@@ -66,7 +69,10 @@ use syntax_pos::{BytePos,
6669
Span,
6770
NO_EXPANSION};
6871

69-
#[derive(Copy, Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]
72+
#[derive(Copy, Clone, Debug, PartialEq, Hash,
73+
RustcDecodable, RustcEncodable,
74+
Serialize, Deserialize,
75+
)]
7076
pub enum Applicability {
7177
MachineApplicable,
7278
HasPlaceholders,

src/libsyntax_pos/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ serialize = { path = "../libserialize" }
1313
rustc_data_structures = { path = "../librustc_data_structures" }
1414
arena = { path = "../libarena" }
1515
scoped-tls = { version = "0.1.1", features = ["nightly"] }
16+
serde = "1.0"
17+
serde_derive = "1.0"
1618
unicode-width = "0.1.4"
1719
cfg-if = "0.1.2"

src/libsyntax_pos/lib.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ extern crate rustc_data_structures;
4343

4444
#[macro_use]
4545
extern crate scoped_tls;
46+
#[macro_use]
47+
extern crate serde_derive;
48+
extern crate serde;
4649

4750
use serialize::{Encodable, Decodable, Encoder, Decoder};
4851

@@ -84,7 +87,10 @@ impl Globals {
8487
scoped_thread_local!(pub static GLOBALS: Globals);
8588

8689
/// Differentiates between real files and common virtual files
87-
#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Hash, RustcDecodable, RustcEncodable)]
90+
#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Hash,
91+
RustcDecodable, RustcEncodable,
92+
Serialize, Deserialize,
93+
)]
8894
pub enum FileName {
8995
Real(PathBuf),
9096
/// A macro. This includes the full name of the macro, so that there are no clashes.

src/tools/tidy/src/deps.rs

+6
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ const WHITELIST: &[Crate] = &[
107107
Crate("parking_lot_core"),
108108
Crate("pkg-config"),
109109
Crate("polonius-engine"),
110+
Crate("proc-macro2"),
110111
Crate("quick-error"),
112+
Crate("quote"),
111113
Crate("rand"),
112114
Crate("rand_core"),
113115
Crate("redox_syscall"),
@@ -121,15 +123,19 @@ const WHITELIST: &[Crate] = &[
121123
Crate("rustc-rayon-core"),
122124
Crate("scoped-tls"),
123125
Crate("scopeguard"),
126+
Crate("serde"),
127+
Crate("serde_derive"),
124128
Crate("smallvec"),
125129
Crate("stable_deref_trait"),
130+
Crate("syn"),
126131
Crate("tempfile"),
127132
Crate("termcolor"),
128133
Crate("terminon"),
129134
Crate("termion"),
130135
Crate("thread_local"),
131136
Crate("ucd-util"),
132137
Crate("unicode-width"),
138+
Crate("unicode-xid"),
133139
Crate("unreachable"),
134140
Crate("utf8-ranges"),
135141
Crate("version_check"),

0 commit comments

Comments
 (0)