Skip to content

Commit 6140371

Browse files
committed
cleanup: Remove extern crate serialize as rustc_serializes
1 parent 3ebca72 commit 6140371

File tree

52 files changed

+99
-147
lines changed

Some content is hidden

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

52 files changed

+99
-147
lines changed

src/librustc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ rustc_target = { path = "../librustc_target" }
2727
rustc_macros = { path = "../librustc_macros" }
2828
rustc_data_structures = { path = "../librustc_data_structures" }
2929
errors = { path = "../librustc_errors", package = "rustc_errors" }
30-
serialize = { path = "../libserialize" }
30+
rustc_serialize = { path = "../libserialize", package = "serialize" }
3131
syntax = { path = "../libsyntax" }
3232
syntax_pos = { path = "../libsyntax_pos" }
3333
backtrace = "0.3.3"

src/librustc/hir/def_id.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::ty::{self, TyCtxt};
22
use crate::hir::map::definitions::FIRST_FREE_DEF_INDEX;
33
use rustc_data_structures::indexed_vec::Idx;
4-
use serialize;
54
use std::fmt;
65
use std::u32;
76

@@ -93,8 +92,8 @@ impl fmt::Display for CrateNum {
9392
}
9493
}
9594

96-
impl serialize::UseSpecializedEncodable for CrateNum {}
97-
impl serialize::UseSpecializedDecodable for CrateNum {}
95+
impl rustc_serialize::UseSpecializedEncodable for CrateNum {}
96+
impl rustc_serialize::UseSpecializedDecodable for CrateNum {}
9897

9998
newtype_index! {
10099
/// A DefIndex is an index into the hir-map for a crate, identifying a
@@ -134,8 +133,8 @@ impl DefIndex {
134133
}
135134
}
136135

137-
impl serialize::UseSpecializedEncodable for DefIndex {}
138-
impl serialize::UseSpecializedDecodable for DefIndex {}
136+
impl rustc_serialize::UseSpecializedEncodable for DefIndex {}
137+
impl rustc_serialize::UseSpecializedDecodable for DefIndex {}
139138

140139
/// A `DefId` identifies a particular *definition*, by combining a crate
141140
/// index and a def index.
@@ -186,8 +185,8 @@ impl DefId {
186185
}
187186
}
188187

189-
impl serialize::UseSpecializedEncodable for DefId {}
190-
impl serialize::UseSpecializedDecodable for DefId {}
188+
impl rustc_serialize::UseSpecializedEncodable for DefId {}
189+
impl rustc_serialize::UseSpecializedDecodable for DefId {}
191190

192191
/// A LocalDefId is equivalent to a DefId with `krate == LOCAL_CRATE`. Since
193192
/// we encode this information in the type, we can ensure at compile time that
@@ -220,5 +219,5 @@ impl fmt::Debug for LocalDefId {
220219
}
221220
}
222221

223-
impl serialize::UseSpecializedEncodable for LocalDefId {}
224-
impl serialize::UseSpecializedDecodable for LocalDefId {}
222+
impl rustc_serialize::UseSpecializedEncodable for LocalDefId {}
223+
impl rustc_serialize::UseSpecializedDecodable for LocalDefId {}

src/librustc/hir/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use rustc_data_structures::sync::{par_for_each_in, Send, Sync};
3434
use rustc_data_structures::thin_vec::ThinVec;
3535
use rustc_macros::HashStable;
3636

37-
use serialize::{self, Encoder, Encodable, Decoder, Decodable};
37+
use rustc_serialize::{self, Encoder, Encodable, Decoder, Decodable};
3838
use std::collections::{BTreeSet, BTreeMap};
3939
use std::fmt;
4040
use smallvec::SmallVec;
@@ -92,7 +92,7 @@ impl HirId {
9292
}
9393
}
9494

95-
impl serialize::UseSpecializedEncodable for HirId {
95+
impl rustc_serialize::UseSpecializedEncodable for HirId {
9696
fn default_encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
9797
let HirId {
9898
owner,
@@ -104,7 +104,7 @@ impl serialize::UseSpecializedEncodable for HirId {
104104
}
105105
}
106106

107-
impl serialize::UseSpecializedDecodable for HirId {
107+
impl rustc_serialize::UseSpecializedDecodable for HirId {
108108
fn default_decode<D: Decoder>(d: &mut D) -> Result<HirId, D::Error> {
109109
let owner = DefIndex::decode(d)?;
110110
let local_id = ItemLocalId::decode(d)?;

src/librustc/hir/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::iter::FromIterator;
77
use std::ops::Deref;
88
use std::{slice, vec};
99

10-
use serialize::{Encodable, Decodable, Encoder, Decoder};
10+
use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
1111

1212
use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult,
1313
HashStable};

src/librustc/infer/canonical/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::infer::region_constraints::MemberConstraint;
2727
use crate::mir::interpret::ConstValue;
2828
use rustc_data_structures::indexed_vec::IndexVec;
2929
use rustc_macros::HashStable;
30-
use serialize::UseSpecializedDecodable;
30+
use rustc_serialize::UseSpecializedDecodable;
3131
use smallvec::SmallVec;
3232
use std::ops::Index;
3333
use syntax::source_map::Span;

src/librustc/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,8 @@ extern crate getopts;
7575
extern crate libc;
7676
#[macro_use] extern crate rustc_macros;
7777
#[macro_use] extern crate rustc_data_structures;
78-
7978
#[macro_use] extern crate log;
8079
#[macro_use] extern crate syntax;
81-
82-
// FIXME: This import is used by deriving `RustcDecodable` and `RustcEncodable`. Removing this
83-
// results in a bunch of "failed to resolve" errors. Hopefully, the compiler moves to serde or
84-
// something, and we can get rid of this.
85-
#[allow(rust_2018_idioms)]
86-
extern crate serialize as rustc_serialize;
87-
8880
#[macro_use] extern crate smallvec;
8981

9082
// Use the test crate here so we depend on getopts through it. This allow tools to link to both

src/librustc/lint/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::lint::{LintArray, Level, Lint, LintId, LintPass, LintBuffer};
2323
use crate::lint::builtin::BuiltinLintDiagnostics;
2424
use crate::lint::levels::{LintLevelSets, LintLevelsBuilder};
2525
use crate::middle::privacy::AccessLevels;
26-
use crate::rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
26+
use rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
2727
use crate::session::{config, early_error, Session};
2828
use crate::ty::{self, print::Printer, subst::Kind, TyCtxt, Ty};
2929
use crate::ty::layout::{LayoutError, LayoutOf, TyLayout};

src/librustc/mir/cache.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
use rustc_data_structures::indexed_vec::IndexVec;
22
use rustc_data_structures::sync::{RwLock, MappedReadGuard, ReadGuard};
3-
use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
4-
StableHasherResult};
3+
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableHasherResult};
4+
use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
55
use crate::ich::StableHashingContext;
66
use crate::mir::{Body, BasicBlock};
77

8-
use crate::rustc_serialize as serialize;
9-
108
#[derive(Clone, Debug)]
119
pub struct Cache {
1210
predecessors: RwLock<Option<IndexVec<BasicBlock, Vec<BasicBlock>>>>
1311
}
1412

1513

16-
impl serialize::Encodable for Cache {
17-
fn encode<S: serialize::Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
18-
serialize::Encodable::encode(&(), s)
14+
impl rustc_serialize::Encodable for Cache {
15+
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
16+
Encodable::encode(&(), s)
1917
}
2018
}
2119

22-
impl serialize::Decodable for Cache {
23-
fn decode<D: serialize::Decoder>(d: &mut D) -> Result<Self, D::Error> {
24-
serialize::Decodable::decode(d).map(|_v: ()| Self::new())
20+
impl rustc_serialize::Decodable for Cache {
21+
fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error> {
22+
Decodable::decode(d).map(|_v: ()| Self::new())
2523
}
2624
}
2725

src/librustc/mir/interpret/allocation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<Tag> Allocation<Tag> {
113113
}
114114
}
115115

116-
impl<'tcx> ::serialize::UseSpecializedDecodable for &'tcx Allocation {}
116+
impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx Allocation {}
117117

118118
/// Byte accessors
119119
impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {

src/librustc/mir/interpret/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::hir::def_id::DefId;
2727
use crate::ty::{self, TyCtxt, Instance, subst::UnpackedKind};
2828
use crate::ty::layout::{self, Size};
2929
use std::io;
30-
use crate::rustc_serialize::{Encoder, Decodable, Encodable};
30+
use rustc_serialize::{Encoder, Decodable, Encodable};
3131
use rustc_data_structures::fx::FxHashMap;
3232
use rustc_data_structures::sync::{Lock as Mutex, HashMapExt};
3333
use rustc_data_structures::tiny_list::TinyList;
@@ -51,8 +51,8 @@ pub struct GlobalId<'tcx> {
5151
#[derive(Copy, Clone, Eq, Hash, Ord, PartialEq, PartialOrd, Debug)]
5252
pub struct AllocId(pub u64);
5353

54-
impl crate::rustc_serialize::UseSpecializedEncodable for AllocId {}
55-
impl crate::rustc_serialize::UseSpecializedDecodable for AllocId {}
54+
impl rustc_serialize::UseSpecializedEncodable for AllocId {}
55+
impl rustc_serialize::UseSpecializedDecodable for AllocId {}
5656

5757
#[derive(RustcDecodable, RustcEncodable)]
5858
enum AllocDiscriminant {

0 commit comments

Comments
 (0)