Skip to content

Commit 98bfe1d

Browse files
eddybZoxc
authored andcommitted
Start using serde_derive in a couple places in the compiler.
1 parent f4a421e commit 98bfe1d

File tree

7 files changed

+25
-2
lines changed

7 files changed

+25
-2
lines changed

src/librustc_cratesio_shim/Cargo.toml

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 7 additions & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ extern crate rustc_data_structures;
3232

3333
#[macro_use]
3434
extern crate scoped_tls;
35+
#[macro_use]
36+
extern crate serde_derive;
37+
extern crate serde;
3538

3639
use serialize::{Encodable, Decodable, Encoder, Decoder};
3740

@@ -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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ const WHITELIST: &[Crate] = &[
115115
Crate("parking_lot_core"),
116116
Crate("pkg-config"),
117117
Crate("polonius-engine"),
118+
Crate("proc-macro2"),
118119
Crate("quick-error"),
120+
Crate("quote"),
119121
Crate("rand"),
120122
Crate("rand_chacha"),
121123
Crate("rand_core"),
@@ -138,15 +140,18 @@ const WHITELIST: &[Crate] = &[
138140
Crate("semver"),
139141
Crate("semver-parser"),
140142
Crate("serde"),
143+
Crate("serde_derive"),
141144
Crate("smallvec"),
142145
Crate("stable_deref_trait"),
146+
Crate("syn"),
143147
Crate("tempfile"),
144148
Crate("termcolor"),
145149
Crate("terminon"),
146150
Crate("termion"),
147151
Crate("thread_local"),
148152
Crate("ucd-util"),
149153
Crate("unicode-width"),
154+
Crate("unicode-xid"),
150155
Crate("unreachable"),
151156
Crate("utf8-ranges"),
152157
Crate("vcpkg"),

0 commit comments

Comments
 (0)