Skip to content

Commit 2390276

Browse files
committed
Auto merge of #56323 - eddyb:que-seri-sera, r=<try>
[WIP] serialize: rename to rustc_serialize. In preparation for post-#49219 use of custom derives in rustc, we'll want to stop using `Rustc{Encodable,Decodable}` derives, and *at least* adapt the library to suit `rustc` better, before a full implementation of #36588 can be done. This will break anyone using `extern crate serialize;` (on nightly) so let's do a crater run with a rename, just to see what things are like. **EDIT**: I was going to test with `rustc_serialize` (which does work in terms of compiling) but I realized that `rustc-serialize` from crates.io might make that tricky if it ends up in our sysroot, so for the crater run let's go with something weirder (`rustc_ezilaires`). **EDIT2**: had to remove `rustc_save_analysis` and `rls` to get rid of the crates.io `rustc-serialize` from Cargo.lock. Note that this is just for crater, just like the `rustc_ezilaires` rename. r? @nikomatsakis
2 parents b68fc18 + 2325917 commit 2390276

File tree

102 files changed

+205
-4716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+205
-4716
lines changed

Cargo.lock

Lines changed: 18 additions & 311 deletions
Large diffs are not rendered by default.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ members = [
1919
"src/tools/rust-installer",
2020
"src/tools/cargo",
2121
"src/tools/rustdoc",
22-
"src/tools/rls",
2322
"src/tools/rustfmt",
2423
"src/tools/miri",
2524
"src/tools/rustdoc-themes",
2625
]
2726
exclude = [
28-
"src/tools/rls/test_data",
27+
"src/tools/rls",
2928
"build",
3029
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
3130
"obj",

src/librustc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ rustc_apfloat = { path = "../librustc_apfloat" }
2525
rustc_target = { path = "../librustc_target" }
2626
rustc_data_structures = { path = "../librustc_data_structures" }
2727
rustc_errors = { path = "../librustc_errors" }
28-
serialize = { path = "../libserialize" }
28+
rustc_ezilaires = { path = "../librustc_ezilaires" }
2929
syntax = { path = "../libsyntax" }
3030
syntax_pos = { path = "../libsyntax_pos" }
3131
backtrace = "0.3.3"

src/librustc/hir/def_id.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use ty;
1212
use hir::map::definitions::FIRST_FREE_HIGH_DEF_INDEX;
1313
use rustc_data_structures::indexed_vec::Idx;
14-
use serialize;
14+
use rustc_ezilaires;
1515
use std::fmt;
1616
use std::u32;
1717

@@ -107,8 +107,8 @@ impl fmt::Display for CrateNum {
107107
}
108108
}
109109

110-
impl serialize::UseSpecializedEncodable for CrateNum {}
111-
impl serialize::UseSpecializedDecodable for CrateNum {}
110+
impl rustc_ezilaires::UseSpecializedEncodable for CrateNum {}
111+
impl rustc_ezilaires::UseSpecializedDecodable for CrateNum {}
112112

113113
/// A DefIndex is an index into the hir-map for a crate, identifying a
114114
/// particular definition. It should really be considered an interned
@@ -199,8 +199,8 @@ impl DefIndex {
199199
}
200200
}
201201

202-
impl serialize::UseSpecializedEncodable for DefIndex {}
203-
impl serialize::UseSpecializedDecodable for DefIndex {}
202+
impl rustc_ezilaires::UseSpecializedEncodable for DefIndex {}
203+
impl rustc_ezilaires::UseSpecializedDecodable for DefIndex {}
204204

205205
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
206206
pub enum DefIndexAddressSpace {
@@ -259,8 +259,8 @@ impl DefId {
259259
}
260260
}
261261

262-
impl serialize::UseSpecializedEncodable for DefId {}
263-
impl serialize::UseSpecializedDecodable for DefId {}
262+
impl rustc_ezilaires::UseSpecializedEncodable for DefId {}
263+
impl rustc_ezilaires::UseSpecializedDecodable for DefId {}
264264

265265
/// A LocalDefId is equivalent to a DefId with `krate == LOCAL_CRATE`. Since
266266
/// we encode this information in the type, we can ensure at compile time that
@@ -293,5 +293,5 @@ impl fmt::Debug for LocalDefId {
293293
}
294294
}
295295

296-
impl serialize::UseSpecializedEncodable for LocalDefId {}
297-
impl serialize::UseSpecializedDecodable for LocalDefId {}
296+
impl rustc_ezilaires::UseSpecializedEncodable for LocalDefId {}
297+
impl rustc_ezilaires::UseSpecializedDecodable for LocalDefId {}

src/librustc/hir/map/definitions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use ich::Fingerprint;
2121
use rustc_data_structures::fx::FxHashMap;
2222
use rustc_data_structures::indexed_vec::{IndexVec};
2323
use rustc_data_structures::stable_hasher::StableHasher;
24-
use serialize::{Encodable, Decodable, Encoder, Decoder};
24+
use rustc_ezilaires::{Encodable, Decodable, Encoder, Decoder};
2525
use session::CrateDisambiguator;
2626
use std::borrow::Borrow;
2727
use std::fmt::Write;

src/librustc/hir/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use ty::query::Providers;
4040
use rustc_data_structures::sync::{ParallelIterator, par_iter, Send, Sync, scope};
4141
use rustc_data_structures::thin_vec::ThinVec;
4242

43-
use serialize::{self, Encoder, Encodable, Decoder, Decodable};
43+
use rustc_ezilaires::{self, Encoder, Encodable, Decoder, Decodable};
4444
use std::collections::BTreeMap;
4545
use std::fmt;
4646

@@ -95,7 +95,7 @@ impl HirId {
9595
}
9696
}
9797

98-
impl serialize::UseSpecializedEncodable for HirId {
98+
impl rustc_ezilaires::UseSpecializedEncodable for HirId {
9999
fn default_encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
100100
let HirId {
101101
owner,
@@ -107,7 +107,7 @@ impl serialize::UseSpecializedEncodable for HirId {
107107
}
108108
}
109109

110-
impl serialize::UseSpecializedDecodable for HirId {
110+
impl rustc_ezilaires::UseSpecializedDecodable for HirId {
111111
fn default_decode<D: Decoder>(d: &mut D) -> Result<HirId, D::Error> {
112112
let owner = DefIndex::decode(d)?;
113113
let local_id = ItemLocalId::decode(d)?;

src/librustc/infer/canonical/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
use infer::{InferCtxt, RegionVariableOrigin, TypeVariableOrigin};
3535
use rustc_data_structures::indexed_vec::IndexVec;
3636
use rustc_data_structures::sync::Lrc;
37-
use serialize::UseSpecializedDecodable;
37+
use rustc_ezilaires::UseSpecializedDecodable;
3838
use smallvec::SmallVec;
3939
use std::ops::Index;
4040
use syntax::source_map::Span;

src/librustc/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ extern crate libc;
8888
extern crate polonius_engine;
8989
extern crate rustc_target;
9090
#[macro_use] extern crate rustc_data_structures;
91-
extern crate serialize;
9291
extern crate parking_lot;
9392
extern crate rustc_errors as errors;
9493
extern crate rustc_rayon as rayon;
@@ -101,7 +100,7 @@ extern crate proc_macro;
101100
extern crate chalk_engine;
102101
extern crate rustc_fs_util;
103102

104-
extern crate serialize as rustc_serialize; // used by deriving
103+
extern crate rustc_ezilaires; use rustc_ezilaires as rustc_serialize; // used by deriving
105104

106105
extern crate rustc_apfloat;
107106
extern crate byteorder;

src/librustc/lint/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use lint::{Level, Lint, LintId, LintPass, LintBuffer};
3333
use lint::builtin::BuiltinLintDiagnostics;
3434
use lint::levels::{LintLevelSets, LintLevelsBuilder};
3535
use middle::privacy::AccessLevels;
36-
use rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
36+
use rustc_ezilaires::{Decoder, Decodable, Encoder, Encodable};
3737
use session::{config, early_error, Session};
3838
use ty::{self, TyCtxt, Ty};
3939
use ty::layout::{LayoutError, LayoutOf, TyLayout};

src/librustc/mir/cache.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
1515
use ich::StableHashingContext;
1616
use mir::{Mir, BasicBlock};
1717

18-
use rustc_serialize as serialize;
18+
use rustc_ezilaires;
1919

2020
#[derive(Clone, Debug)]
2121
pub struct Cache {
2222
predecessors: RwLock<Option<IndexVec<BasicBlock, Vec<BasicBlock>>>>
2323
}
2424

2525

26-
impl serialize::Encodable for Cache {
27-
fn encode<S: serialize::Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
28-
serialize::Encodable::encode(&(), s)
26+
impl rustc_ezilaires::Encodable for Cache {
27+
fn encode<S: rustc_ezilaires::Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
28+
rustc_ezilaires::Encodable::encode(&(), s)
2929
}
3030
}
3131

32-
impl serialize::Decodable for Cache {
33-
fn decode<D: serialize::Decoder>(d: &mut D) -> Result<Self, D::Error> {
34-
serialize::Decodable::decode(d).map(|_v: ()| Self::new())
32+
impl rustc_ezilaires::Decodable for Cache {
33+
fn decode<D: rustc_ezilaires::Decoder>(d: &mut D) -> Result<Self, D::Error> {
34+
rustc_ezilaires::Decodable::decode(d).map(|_v: ()| Self::new())
3535
}
3636
}
3737

0 commit comments

Comments
 (0)