about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/Cargo.toml2
-rw-r--r--src/librustc_data_structures/fingerprint.rs11
-rw-r--r--src/librustc_data_structures/indexed_vec.rs30
-rw-r--r--src/librustc_data_structures/lib.rs2
-rw-r--r--src/librustc_data_structures/svh.rs2
5 files changed, 18 insertions, 29 deletions
diff --git a/src/librustc_data_structures/Cargo.toml b/src/librustc_data_structures/Cargo.toml
index 79cbe26e73e..288676ce3ff 100644
--- a/src/librustc_data_structures/Cargo.toml
+++ b/src/librustc_data_structures/Cargo.toml
@@ -15,7 +15,7 @@ indexmap = "1"
 log = "0.4"
 jobserver_crate = { version = "0.1.13", package = "jobserver" }
 lazy_static = "1"
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
 graphviz = { path = "../libgraphviz" }
 cfg-if = "0.1.2"
 crossbeam-utils = { version = "0.6.5", features = ["nightly"] }
diff --git a/src/librustc_data_structures/fingerprint.rs b/src/librustc_data_structures/fingerprint.rs
index 3bea965ef30..c8012bb9424 100644
--- a/src/librustc_data_structures/fingerprint.rs
+++ b/src/librustc_data_structures/fingerprint.rs
@@ -1,7 +1,6 @@
 use crate::stable_hasher;
 use std::mem;
-use serialize;
-use serialize::opaque::{EncodeResult, Encoder, Decoder};
+use rustc_serialize::opaque::{EncodeResult, Encoder, Decoder};
 
 #[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Clone, Copy)]
 pub struct Fingerprint(u64, u64);
@@ -85,17 +84,17 @@ impl stable_hasher::StableHasherResult for Fingerprint {
 
 impl_stable_hash_via_hash!(Fingerprint);
 
-impl serialize::UseSpecializedEncodable for Fingerprint { }
+impl rustc_serialize::UseSpecializedEncodable for Fingerprint { }
 
-impl serialize::UseSpecializedDecodable for Fingerprint { }
+impl rustc_serialize::UseSpecializedDecodable for Fingerprint { }
 
-impl serialize::SpecializedEncoder<Fingerprint> for serialize::opaque::Encoder {
+impl rustc_serialize::SpecializedEncoder<Fingerprint> for Encoder {
     fn specialized_encode(&mut self, f: &Fingerprint) -> Result<(), Self::Error> {
         f.encode_opaque(self)
     }
 }
 
-impl<'a> serialize::SpecializedDecoder<Fingerprint> for serialize::opaque::Decoder<'a> {
+impl<'a> rustc_serialize::SpecializedDecoder<Fingerprint> for Decoder<'a> {
     fn specialized_decode(&mut self) -> Result<Fingerprint, Self::Error> {
         Fingerprint::decode_opaque(self)
     }
diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs
index c3c76e81606..6f40d059be2 100644
--- a/src/librustc_data_structures/indexed_vec.rs
+++ b/src/librustc_data_structures/indexed_vec.rs
@@ -1,3 +1,5 @@
+use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
+
 use std::fmt::Debug;
 use std::iter::{self, FromIterator};
 use std::slice;
@@ -8,8 +10,6 @@ use std::hash::Hash;
 use std::vec;
 use std::u32;
 
-use rustc_serialize as serialize;
-
 /// Represents some newtyped `usize` wrapper.
 ///
 /// Purpose: avoid mixing indexes for different bitvector domains.
@@ -398,17 +398,9 @@ macro_rules! newtype_index {
     );
 
     (@decodable $type:ident) => (
-        impl $type {
-            fn __decodable__impl__hack() {
-                mod __more_hacks_because__self_doesnt_work_in_functions {
-                    extern crate serialize;
-                    use self::serialize::{Decodable, Decoder};
-                    impl Decodable for super::$type {
-                        fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error> {
-                            d.read_u32().map(Self::from)
-                        }
-                    }
-                }
+        impl ::rustc_serialize::Decodable for $type {
+            fn decode<D: ::rustc_serialize::Decoder>(d: &mut D) -> Result<Self, D::Error> {
+                d.read_u32().map(Self::from)
             }
         }
     );
@@ -521,15 +513,15 @@ pub struct IndexVec<I: Idx, T> {
 // not the phantom data.
 unsafe impl<I: Idx, T> Send for IndexVec<I, T> where T: Send {}
 
-impl<I: Idx, T: serialize::Encodable> serialize::Encodable for IndexVec<I, T> {
-    fn encode<S: serialize::Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
-        serialize::Encodable::encode(&self.raw, s)
+impl<I: Idx, T: Encodable> Encodable for IndexVec<I, T> {
+    fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
+        Encodable::encode(&self.raw, s)
     }
 }
 
-impl<I: Idx, T: serialize::Decodable> serialize::Decodable for IndexVec<I, T> {
-    fn decode<D: serialize::Decoder>(d: &mut D) -> Result<Self, D::Error> {
-        serialize::Decodable::decode(d).map(|v| {
+impl<I: Idx, T: Decodable> Decodable for IndexVec<I, T> {
+    fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error> {
+        Decodable::decode(d).map(|v| {
             IndexVec { raw: v, _marker: PhantomData }
         })
     }
diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs
index a2407681e6d..3047119029a 100644
--- a/src/librustc_data_structures/lib.rs
+++ b/src/librustc_data_structures/lib.rs
@@ -31,8 +31,6 @@
 
 #[macro_use]
 extern crate log;
-#[allow(unused_extern_crates)]
-extern crate serialize as rustc_serialize; // used by deriving
 #[cfg(unix)]
 extern crate libc;
 #[macro_use]
diff --git a/src/librustc_data_structures/svh.rs b/src/librustc_data_structures/svh.rs
index df4f6176837..3123c182b0f 100644
--- a/src/librustc_data_structures/svh.rs
+++ b/src/librustc_data_structures/svh.rs
@@ -7,7 +7,7 @@
 
 use std::fmt;
 use std::hash::{Hash, Hasher};
-use serialize::{Encodable, Decodable, Encoder, Decoder};
+use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
 
 use crate::stable_hasher;