From d76e861287ae67448d622f8b395c56b198962ee4 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Wed, 28 Nov 2018 19:26:54 +0200 Subject: [PATCH] serialize: rename to rustc_serialize. --- Cargo.lock | 36 +++++++++---------- src/librustc/Cargo.toml | 2 +- src/librustc/hir/def_id.rs | 18 +++++----- src/librustc/hir/map/definitions.rs | 2 +- src/librustc/hir/mod.rs | 6 ++-- src/librustc/infer/canonical/mod.rs | 2 +- src/librustc/lib.rs | 3 +- src/librustc/mir/cache.rs | 14 ++++---- src/librustc/mir/interpret/allocation.rs | 2 +- src/librustc/mir/mod.rs | 8 +++-- src/librustc/ty/mod.rs | 16 ++++----- src/librustc/ty/sty.rs | 8 ++--- src/librustc/ty/subst.rs | 4 +-- src/librustc_codegen_llvm/back/wasm.rs | 2 +- src/librustc_codegen_llvm/lib.rs | 2 +- src/librustc_codegen_ssa/Cargo.toml | 2 +- src/librustc_codegen_ssa/back/linker.rs | 2 +- src/librustc_codegen_ssa/lib.rs | 2 +- src/librustc_data_structures/Cargo.toml | 2 +- src/librustc_data_structures/fingerprint.rs | 12 +++---- src/librustc_data_structures/indexed_vec.rs | 14 ++++---- src/librustc_data_structures/lib.rs | 3 +- src/librustc_data_structures/svh.rs | 2 +- src/librustc_driver/Cargo.toml | 2 +- src/librustc_driver/driver.rs | 2 +- src/librustc_driver/lib.rs | 4 +-- src/librustc_errors/Cargo.toml | 2 +- src/librustc_errors/lib.rs | 2 +- src/librustc_incremental/Cargo.toml | 2 +- src/librustc_incremental/lib.rs | 2 +- src/librustc_metadata/Cargo.toml | 2 +- src/librustc_metadata/lib.rs | 2 +- src/librustc_metadata/schema.rs | 10 +++--- src/librustc_mir/Cargo.toml | 2 +- src/librustc_mir/lib.rs | 2 +- .../Cargo.toml | 4 +-- .../collection_impls.rs | 0 .../hex.rs | 8 ++--- .../json.rs | 12 +++---- .../leb128.rs | 0 .../lib.rs | 4 --- .../opaque.rs | 2 +- .../serialize.rs | 0 src/librustc_target/Cargo.toml | 2 +- src/librustc_target/lib.rs | 3 +- src/librustc_target/spec/mod.rs | 6 ++-- src/librustdoc/html/render.rs | 2 +- src/librustdoc/lib.rs | 3 +- src/libsyntax/Cargo.toml | 2 +- src/libsyntax/ast.rs | 10 +++--- src/libsyntax/lib.rs | 3 +- src/libsyntax/parse/token.rs | 2 +- src/libsyntax/ptr.rs | 2 +- src/libsyntax/tokenstream.rs | 2 +- src/libsyntax_ext/deriving/generic/mod.rs | 2 +- src/libsyntax_pos/Cargo.toml | 2 +- src/libsyntax_pos/hygiene.rs | 2 +- src/libsyntax_pos/lib.rs | 9 +++-- src/libsyntax_pos/symbol.rs | 2 +- src/libtest/formatters/json.rs | 2 +- .../pretty-expanded/input.rs | 2 +- .../save-analysis-fail/foo.rs | 2 +- .../run-make-fulldeps/save-analysis/foo.rs | 2 +- .../derive-no-std-not-supported.rs | 2 +- .../deriving-encodable-decodable-box.rs | 8 ++--- ...riving-encodable-decodable-cell-refcell.rs | 8 ++--- src/test/run-pass-fulldeps/deriving-global.rs | 4 +-- .../run-pass-fulldeps/deriving-hygiene.rs | 4 +-- .../empty-struct-braces-derive.rs | 2 +- .../run-pass-fulldeps/extern-mod-syntax.rs | 4 +-- src/test/run-pass-fulldeps/issue-11881.rs | 10 +++--- src/test/run-pass-fulldeps/issue-14021.rs | 8 ++--- src/test/run-pass-fulldeps/issue-15924.rs | 6 ++-- src/test/run-pass-fulldeps/issue-24972.rs | 4 +-- src/test/run-pass-fulldeps/issue-2804.rs | 4 +-- src/test/run-pass-fulldeps/issue-4016.rs | 4 +-- src/test/run-pass-fulldeps/issue-4036.rs | 4 +-- .../rustc_encodable_hygiene.rs | 2 +- src/test/ui-fulldeps/deprecated-derive.rs | 2 +- src/tools/error_index_generator/main.rs | 2 +- 80 files changed, 180 insertions(+), 188 deletions(-) rename src/{libserialize => librustc_serialize}/Cargo.toml (79%) rename src/{libserialize => librustc_serialize}/collection_impls.rs (100%) rename src/{libserialize => librustc_serialize}/hex.rs (97%) rename src/{libserialize => librustc_serialize}/json.rs (99%) rename src/{libserialize => librustc_serialize}/leb128.rs (100%) rename src/{libserialize => librustc_serialize}/lib.rs (96%) rename src/{libserialize => librustc_serialize}/opaque.rs (99%) rename src/{libserialize => librustc_serialize}/serialize.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 234485afa809f..d2c35411197bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1933,9 +1933,9 @@ dependencies = [ "rustc_data_structures 0.0.0", "rustc_errors 0.0.0", "rustc_fs_util 0.0.0", + "rustc_serialize 0.0.0", "rustc_target 0.0.0", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serialize 0.0.0", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "syntax 0.0.0", "syntax_pos 0.0.0", @@ -2187,8 +2187,8 @@ dependencies = [ "rustc_fs_util 0.0.0", "rustc_incremental 0.0.0", "rustc_mir 0.0.0", + "rustc_serialize 0.0.0", "rustc_target 0.0.0", - "serialize 0.0.0", "syntax 0.0.0", "syntax_pos 0.0.0", ] @@ -2231,7 +2231,7 @@ dependencies = [ "rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_cratesio_shim 0.0.0", - "serialize 0.0.0", + "rustc_serialize 0.0.0", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2261,11 +2261,11 @@ dependencies = [ "rustc_privacy 0.0.0", "rustc_resolve 0.0.0", "rustc_save_analysis 0.0.0", + "rustc_serialize 0.0.0", "rustc_target 0.0.0", "rustc_traits 0.0.0", "rustc_typeck 0.0.0", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serialize 0.0.0", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "syntax 0.0.0", "syntax_ext 0.0.0", @@ -2280,7 +2280,7 @@ dependencies = [ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_cratesio_shim 0.0.0", "rustc_data_structures 0.0.0", - "serialize 0.0.0", + "rustc_serialize 0.0.0", "syntax_pos 0.0.0", "termcolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2300,7 +2300,7 @@ dependencies = [ "rustc 0.0.0", "rustc_data_structures 0.0.0", "rustc_fs_util 0.0.0", - "serialize 0.0.0", + "rustc_serialize 0.0.0", "syntax 0.0.0", "syntax_pos 0.0.0", ] @@ -2347,8 +2347,8 @@ dependencies = [ "rustc 0.0.0", "rustc_data_structures 0.0.0", "rustc_errors 0.0.0", + "rustc_serialize 0.0.0", "rustc_target 0.0.0", - "serialize 0.0.0", "stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntax 0.0.0", "syntax_ext 0.0.0", @@ -2371,8 +2371,8 @@ dependencies = [ "rustc_apfloat 0.0.0", "rustc_data_structures 0.0.0", "rustc_errors 0.0.0", + "rustc_serialize 0.0.0", "rustc_target 0.0.0", - "serialize 0.0.0", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "syntax 0.0.0", "syntax_pos 0.0.0", @@ -2460,6 +2460,13 @@ dependencies = [ "syntax_pos 0.0.0", ] +[[package]] +name = "rustc_serialize" +version = "0.0.0" +dependencies = [ + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc_target" version = "0.0.0" @@ -2468,7 +2475,7 @@ dependencies = [ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_cratesio_shim 0.0.0", "rustc_data_structures 0.0.0", - "serialize 0.0.0", + "rustc_serialize 0.0.0", ] [[package]] @@ -2678,13 +2685,6 @@ dependencies = [ "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "serialize" -version = "0.0.0" -dependencies = [ - "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "shell-escape" version = "0.1.4" @@ -2869,9 +2869,9 @@ dependencies = [ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_data_structures 0.0.0", "rustc_errors 0.0.0", + "rustc_serialize 0.0.0", "rustc_target 0.0.0", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serialize 0.0.0", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "syntax_pos 0.0.0", ] @@ -2897,8 +2897,8 @@ dependencies = [ "arena 0.0.0", "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_data_structures 0.0.0", + "rustc_serialize 0.0.0", "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serialize 0.0.0", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/src/librustc/Cargo.toml b/src/librustc/Cargo.toml index 3316735de663e..b3f1d484770b7 100644 --- a/src/librustc/Cargo.toml +++ b/src/librustc/Cargo.toml @@ -24,7 +24,7 @@ rustc_apfloat = { path = "../librustc_apfloat" } rustc_target = { path = "../librustc_target" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_errors = { path = "../librustc_errors" } -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } backtrace = "0.3.3" diff --git a/src/librustc/hir/def_id.rs b/src/librustc/hir/def_id.rs index 319d63f66c465..e3d421918822c 100644 --- a/src/librustc/hir/def_id.rs +++ b/src/librustc/hir/def_id.rs @@ -11,7 +11,7 @@ use ty; use hir::map::definitions::FIRST_FREE_HIGH_DEF_INDEX; use rustc_data_structures::indexed_vec::Idx; -use serialize; +use rustc_serialize; use std::fmt; use std::u32; @@ -107,8 +107,8 @@ impl fmt::Display for CrateNum { } } -impl serialize::UseSpecializedEncodable for CrateNum {} -impl serialize::UseSpecializedDecodable for CrateNum {} +impl rustc_serialize::UseSpecializedEncodable for CrateNum {} +impl rustc_serialize::UseSpecializedDecodable for CrateNum {} /// A DefIndex is an index into the hir-map for a crate, identifying a /// particular definition. It should really be considered an interned @@ -199,8 +199,8 @@ impl DefIndex { } } -impl serialize::UseSpecializedEncodable for DefIndex {} -impl serialize::UseSpecializedDecodable for DefIndex {} +impl rustc_serialize::UseSpecializedEncodable for DefIndex {} +impl rustc_serialize::UseSpecializedDecodable for DefIndex {} #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub enum DefIndexAddressSpace { @@ -259,8 +259,8 @@ impl DefId { } } -impl serialize::UseSpecializedEncodable for DefId {} -impl serialize::UseSpecializedDecodable for DefId {} +impl rustc_serialize::UseSpecializedEncodable for DefId {} +impl rustc_serialize::UseSpecializedDecodable for DefId {} /// A LocalDefId is equivalent to a DefId with `krate == LOCAL_CRATE`. Since /// we encode this information in the type, we can ensure at compile time that @@ -293,5 +293,5 @@ impl fmt::Debug for LocalDefId { } } -impl serialize::UseSpecializedEncodable for LocalDefId {} -impl serialize::UseSpecializedDecodable for LocalDefId {} +impl rustc_serialize::UseSpecializedEncodable for LocalDefId {} +impl rustc_serialize::UseSpecializedDecodable for LocalDefId {} diff --git a/src/librustc/hir/map/definitions.rs b/src/librustc/hir/map/definitions.rs index eb9bd183fd939..ca712d9b4a876 100644 --- a/src/librustc/hir/map/definitions.rs +++ b/src/librustc/hir/map/definitions.rs @@ -21,7 +21,7 @@ use ich::Fingerprint; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::indexed_vec::{IndexVec}; use rustc_data_structures::stable_hasher::StableHasher; -use serialize::{Encodable, Decodable, Encoder, Decoder}; +use rustc_serialize::{Encodable, Decodable, Encoder, Decoder}; use session::CrateDisambiguator; use std::borrow::Borrow; use std::fmt::Write; diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 1674320165e65..84ca83a10bd05 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -40,7 +40,7 @@ use ty::query::Providers; use rustc_data_structures::sync::{ParallelIterator, par_iter, Send, Sync, scope}; use rustc_data_structures::thin_vec::ThinVec; -use serialize::{self, Encoder, Encodable, Decoder, Decodable}; +use rustc_serialize::{self, Encoder, Encodable, Decoder, Decodable}; use std::collections::BTreeMap; use std::fmt; @@ -95,7 +95,7 @@ impl HirId { } } -impl serialize::UseSpecializedEncodable for HirId { +impl rustc_serialize::UseSpecializedEncodable for HirId { fn default_encode(&self, s: &mut S) -> Result<(), S::Error> { let HirId { owner, @@ -107,7 +107,7 @@ impl serialize::UseSpecializedEncodable for HirId { } } -impl serialize::UseSpecializedDecodable for HirId { +impl rustc_serialize::UseSpecializedDecodable for HirId { fn default_decode(d: &mut D) -> Result { let owner = DefIndex::decode(d)?; let local_id = ItemLocalId::decode(d)?; diff --git a/src/librustc/infer/canonical/mod.rs b/src/librustc/infer/canonical/mod.rs index 6b0fa79b201fc..654023889f18d 100644 --- a/src/librustc/infer/canonical/mod.rs +++ b/src/librustc/infer/canonical/mod.rs @@ -34,7 +34,7 @@ use infer::{InferCtxt, RegionVariableOrigin, TypeVariableOrigin}; use rustc_data_structures::indexed_vec::IndexVec; use rustc_data_structures::sync::Lrc; -use serialize::UseSpecializedDecodable; +use rustc_serialize::UseSpecializedDecodable; use smallvec::SmallVec; use std::ops::Index; use syntax::source_map::Span; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index ddb0c5bf22ab6..1c382685f0f54 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -87,7 +87,6 @@ extern crate libc; extern crate polonius_engine; extern crate rustc_target; #[macro_use] extern crate rustc_data_structures; -extern crate serialize; extern crate parking_lot; extern crate rustc_errors as errors; extern crate rustc_rayon as rayon; @@ -100,7 +99,7 @@ extern crate proc_macro; extern crate chalk_engine; extern crate rustc_fs_util; -extern crate serialize as rustc_serialize; // used by deriving +extern crate rustc_serialize; // used by deriving extern crate rustc_apfloat; extern crate byteorder; diff --git a/src/librustc/mir/cache.rs b/src/librustc/mir/cache.rs index 32c60c143065d..fc134c0c53427 100644 --- a/src/librustc/mir/cache.rs +++ b/src/librustc/mir/cache.rs @@ -15,7 +15,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher, use ich::StableHashingContext; use mir::{Mir, BasicBlock}; -use rustc_serialize as serialize; +use rustc_serialize; #[derive(Clone, Debug)] pub struct Cache { @@ -23,15 +23,15 @@ pub struct Cache { } -impl serialize::Encodable for Cache { - fn encode(&self, s: &mut S) -> Result<(), S::Error> { - serialize::Encodable::encode(&(), s) +impl rustc_serialize::Encodable for Cache { + fn encode(&self, s: &mut S) -> Result<(), S::Error> { + rustc_serialize::Encodable::encode(&(), s) } } -impl serialize::Decodable for Cache { - fn decode(d: &mut D) -> Result { - serialize::Decodable::decode(d).map(|_v: ()| Self::new()) +impl rustc_serialize::Decodable for Cache { + fn decode(d: &mut D) -> Result { + rustc_serialize::Decodable::decode(d).map(|_v: ()| Self::new()) } } diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs index ab3bc4cdf9fb6..08ca5221a95e1 100644 --- a/src/librustc/mir/interpret/allocation.rs +++ b/src/librustc/mir/interpret/allocation.rs @@ -139,7 +139,7 @@ impl Allocation { } } -impl<'tcx> ::serialize::UseSpecializedDecodable for &'tcx Allocation {} +impl<'tcx> ::rustc_serialize::UseSpecializedDecodable for &'tcx Allocation {} /// Alignment and bounds checks impl<'tcx, Tag, Extra> Allocation { diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 368f83eb61127..f068a92b54d67 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -25,7 +25,7 @@ use rustc_data_structures::graph::{self, GraphPredecessors, GraphSuccessors}; use rustc_data_structures::indexed_vec::{Idx, IndexVec}; use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::MappedReadGuard; -use rustc_serialize as serialize; +use rustc_serialize; use smallvec::SmallVec; use std::borrow::Cow; use std::fmt::{self, Debug, Formatter, Write}; @@ -456,8 +456,10 @@ impl ClearCrossCrate { } } -impl serialize::UseSpecializedEncodable for ClearCrossCrate {} -impl serialize::UseSpecializedDecodable for ClearCrossCrate {} +impl rustc_serialize::UseSpecializedEncodable + for ClearCrossCrate {} +impl rustc_serialize::UseSpecializedDecodable + for ClearCrossCrate {} /// Grouped information about the source code origin of a MIR entity. /// Intended to be inspected by diagnostics and debuginfo. diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 4633ab1166347..19f2932192275 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -41,7 +41,7 @@ use util::nodemap::{NodeSet, DefIdMap, FxHashMap}; use arena::SyncDroplessArena; use session::DataTypeKind; -use serialize::{self, Encodable, Encoder}; +use rustc_serialize::{self, Encodable, Encoder}; use std::cell::RefCell; use std::cmp::{self, Ordering}; use std::fmt; @@ -598,8 +598,8 @@ impl<'a, 'gcx> HashStable> for ty::TyS<'gcx> { pub type Ty<'tcx> = &'tcx TyS<'tcx>; -impl<'tcx> serialize::UseSpecializedEncodable for Ty<'tcx> {} -impl<'tcx> serialize::UseSpecializedDecodable for Ty<'tcx> {} +impl<'tcx> rustc_serialize::UseSpecializedEncodable for Ty<'tcx> {} +impl<'tcx> rustc_serialize::UseSpecializedDecodable for Ty<'tcx> {} pub type CanonicalTy<'gcx> = Canonical<'gcx, Ty<'gcx>>; @@ -718,7 +718,7 @@ impl<'a, T> IntoIterator for &'a List { } } -impl<'tcx> serialize::UseSpecializedDecodable for &'tcx List> {} +impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx List> {} impl List { #[inline(always)] @@ -995,8 +995,8 @@ pub struct GenericPredicates<'tcx> { pub predicates: Vec<(Predicate<'tcx>, Span)>, } -impl<'tcx> serialize::UseSpecializedEncodable for GenericPredicates<'tcx> {} -impl<'tcx> serialize::UseSpecializedDecodable for GenericPredicates<'tcx> {} +impl<'tcx> rustc_serialize::UseSpecializedEncodable for GenericPredicates<'tcx> {} +impl<'tcx> rustc_serialize::UseSpecializedDecodable for GenericPredicates<'tcx> {} impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> { pub fn instantiate(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, substs: &Substs<'tcx>) @@ -1905,13 +1905,13 @@ impl Hash for AdtDef { } } -impl<'tcx> serialize::UseSpecializedEncodable for &'tcx AdtDef { +impl<'tcx> rustc_serialize::UseSpecializedEncodable for &'tcx AdtDef { fn default_encode(&self, s: &mut S) -> Result<(), S::Error> { self.did.encode(s) } } -impl<'tcx> serialize::UseSpecializedDecodable for &'tcx AdtDef {} +impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx AdtDef {} impl<'a> HashStable> for AdtDef { diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 1416cb17feaed..49cb729543188 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -29,7 +29,7 @@ use rustc_target::spec::abi; use syntax::ast::{self, Ident}; use syntax::symbol::{keywords, InternedString}; -use serialize; +use rustc_serialize; use hir; @@ -578,7 +578,7 @@ impl<'a, 'gcx, 'tcx> Binder> { } } -impl<'tcx> serialize::UseSpecializedDecodable for &'tcx List> {} +impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx List> {} impl<'tcx> List> { pub fn principal(&self) -> ExistentialTraitRef<'tcx> { @@ -1193,7 +1193,7 @@ pub enum RegionKind { ReClosureBound(RegionVid), } -impl<'tcx> serialize::UseSpecializedDecodable for Region<'tcx> {} +impl<'tcx> rustc_serialize::UseSpecializedDecodable for Region<'tcx> {} #[derive(Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Debug, PartialOrd, Ord)] pub struct EarlyBoundRegion { @@ -2108,4 +2108,4 @@ impl<'tcx> Const<'tcx> { } } -impl<'tcx> serialize::UseSpecializedDecodable for &'tcx Const<'tcx> {} +impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx Const<'tcx> {} diff --git a/src/librustc/ty/subst.rs b/src/librustc/ty/subst.rs index 3425203989891..c90fc23766d20 100644 --- a/src/librustc/ty/subst.rs +++ b/src/librustc/ty/subst.rs @@ -15,7 +15,7 @@ use infer::canonical::Canonical; use ty::{self, BoundVar, Lift, List, Ty, TyCtxt}; use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; -use serialize::{self, Encodable, Encoder, Decodable, Decoder}; +use rustc_serialize::{self, Encodable, Encoder, Decodable, Decoder}; use syntax_pos::{Span, DUMMY_SP}; use rustc_data_structures::indexed_vec::Idx; use smallvec::SmallVec; @@ -352,7 +352,7 @@ impl<'tcx> TypeFoldable<'tcx> for &'tcx Substs<'tcx> { } } -impl<'tcx> serialize::UseSpecializedDecodable for &'tcx Substs<'tcx> {} +impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx Substs<'tcx> {} /////////////////////////////////////////////////////////////////////////// // Public trait `Subst` diff --git a/src/librustc_codegen_llvm/back/wasm.rs b/src/librustc_codegen_llvm/back/wasm.rs index 1a5c65f3c4397..36696b593de76 100644 --- a/src/librustc_codegen_llvm/back/wasm.rs +++ b/src/librustc_codegen_llvm/back/wasm.rs @@ -13,7 +13,7 @@ use std::path::Path; use std::str; use rustc_data_structures::fx::FxHashMap; -use serialize::leb128; +use rustc_serialize::leb128; // https://webassembly.github.io/spec/core/binary/modules.html#binary-importsec const WASM_IMPORT_SECTION_ID: u8 = 2; diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs index 4f90cb793b6d2..56c2190dd481e 100644 --- a/src/librustc_codegen_llvm/lib.rs +++ b/src/librustc_codegen_llvm/lib.rs @@ -62,7 +62,7 @@ extern crate rustc_fs_util; #[macro_use] extern crate syntax; extern crate syntax_pos; extern crate rustc_errors as errors; -extern crate serialize; +extern crate rustc_serialize; extern crate cc; // Used to locate MSVC extern crate tempfile; extern crate memmap; diff --git a/src/librustc_codegen_ssa/Cargo.toml b/src/librustc_codegen_ssa/Cargo.toml index 7b1c7cfb56f4c..5ae0c4c161a9c 100644 --- a/src/librustc_codegen_ssa/Cargo.toml +++ b/src/librustc_codegen_ssa/Cargo.toml @@ -19,7 +19,7 @@ log = "0.4.5" libc = "0.2.43" jobserver = "0.1.11" -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } rustc = { path = "../librustc" } diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs index f3cc344254fea..f832a432ec74a 100644 --- a/src/librustc_codegen_ssa/back/linker.rs +++ b/src/librustc_codegen_ssa/back/linker.rs @@ -26,7 +26,7 @@ use rustc::session::config::{self, CrateType, OptLevel, DebugInfo, CrossLangLto}; use rustc::ty::TyCtxt; use rustc_target::spec::{LinkerFlavor, LldFlavor}; -use serialize::{json, Encoder}; +use rustc_serialize::{json, Encoder}; /// For all the linkers we support, and information they might /// need out of the shared crate context before we get rid of it. diff --git a/src/librustc_codegen_ssa/lib.rs b/src/librustc_codegen_ssa/lib.rs index 24ede4db6e3df..42d46fa0f15f1 100644 --- a/src/librustc_codegen_ssa/lib.rs +++ b/src/librustc_codegen_ssa/lib.rs @@ -41,7 +41,7 @@ extern crate rustc_codegen_utils; extern crate rustc_data_structures; extern crate rustc_allocator; extern crate rustc_fs_util; -extern crate serialize; +extern crate rustc_serialize; extern crate rustc_errors; extern crate rustc_demangle; extern crate cc; diff --git a/src/librustc_data_structures/Cargo.toml b/src/librustc_data_structures/Cargo.toml index 188919d063351..40ba3f9bb7209 100644 --- a/src/librustc_data_structures/Cargo.toml +++ b/src/librustc_data_structures/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["dylib"] ena = "0.11" log = "0.4" rustc_cratesio_shim = { path = "../librustc_cratesio_shim" } -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } graphviz = { path = "../libgraphviz" } cfg-if = "0.1.2" stable_deref_trait = "1.0.0" diff --git a/src/librustc_data_structures/fingerprint.rs b/src/librustc_data_structures/fingerprint.rs index aa9ddda2b9364..17a0348e5b292 100644 --- a/src/librustc_data_structures/fingerprint.rs +++ b/src/librustc_data_structures/fingerprint.rs @@ -10,8 +10,8 @@ use std::mem; use stable_hasher; -use serialize; -use serialize::opaque::{EncodeResult, Encoder, Decoder}; +use rustc_serialize; +use rustc_serialize::opaque::{EncodeResult, Encoder, Decoder}; #[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Clone, Copy)] pub struct Fingerprint(u64, u64); @@ -94,17 +94,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 for serialize::opaque::Encoder { +impl rustc_serialize::SpecializedEncoder for rustc_serialize::opaque::Encoder { fn specialized_encode(&mut self, f: &Fingerprint) -> Result<(), Self::Error> { f.encode_opaque(self) } } -impl<'a> serialize::SpecializedDecoder for serialize::opaque::Decoder<'a> { +impl<'a> rustc_serialize::SpecializedDecoder for rustc_serialize::opaque::Decoder<'a> { fn specialized_decode(&mut self) -> Result { Fingerprint::decode_opaque(self) } diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs index a59bf9d530c4d..e4744f63383ca 100644 --- a/src/librustc_data_structures/indexed_vec.rs +++ b/src/librustc_data_structures/indexed_vec.rs @@ -18,7 +18,7 @@ use std::hash::Hash; use std::vec; use std::u32; -use rustc_serialize as serialize; +use rustc_serialize; /// Represents some newtyped `usize` wrapper. /// @@ -466,15 +466,15 @@ pub struct IndexVec { // not the phantom data. unsafe impl Send for IndexVec where T: Send {} -impl serialize::Encodable for IndexVec { - fn encode(&self, s: &mut S) -> Result<(), S::Error> { - serialize::Encodable::encode(&self.raw, s) +impl rustc_serialize::Encodable for IndexVec { + fn encode(&self, s: &mut S) -> Result<(), S::Error> { + rustc_serialize::Encodable::encode(&self.raw, s) } } -impl serialize::Decodable for IndexVec { - fn decode(d: &mut D) -> Result { - serialize::Decodable::decode(d).map(|v| { +impl rustc_serialize::Decodable for IndexVec { + fn decode(d: &mut D) -> Result { + rustc_serialize::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 96cb235a93362..ed25c71f5417f 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -38,7 +38,7 @@ extern crate core; extern crate ena; #[macro_use] extern crate log; -extern crate serialize as rustc_serialize; // used by deriving +extern crate rustc_serialize; // used by deriving #[cfg(unix)] extern crate libc; extern crate parking_lot; @@ -48,7 +48,6 @@ extern crate stable_deref_trait; extern crate rustc_rayon as rayon; extern crate rustc_rayon_core as rayon_core; extern crate rustc_hash; -extern crate serialize; extern crate graphviz; extern crate smallvec; diff --git a/src/librustc_data_structures/svh.rs b/src/librustc_data_structures/svh.rs index 3d17824608cc8..6715a1bd6721d 100644 --- a/src/librustc_data_structures/svh.rs +++ b/src/librustc_data_structures/svh.rs @@ -17,7 +17,7 @@ use std::fmt; use std::hash::{Hash, Hasher}; -use serialize::{Encodable, Decodable, Encoder, Decoder}; +use rustc_serialize::{Encodable, Decodable, Encoder, Decoder}; use stable_hasher; diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml index 1e32f5ef6f0b6..1e42045896460 100644 --- a/src/librustc_driver/Cargo.toml +++ b/src/librustc_driver/Cargo.toml @@ -33,7 +33,7 @@ rustc_save_analysis = { path = "../librustc_save_analysis" } rustc_traits = { path = "../librustc_traits" } rustc_codegen_utils = { path = "../librustc_codegen_utils" } rustc_typeck = { path = "../librustc_typeck" } -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } syntax = { path = "../libsyntax" } smallvec = { version = "0.6.5", features = ["union"] } syntax_ext = { path = "../libsyntax_ext" } diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index c1705ad2d58ff..b37816dd714e4 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -40,7 +40,7 @@ use rustc_plugin as plugin; use rustc_passes::{self, ast_validation, hir_stats, loops, rvalue_promotion}; use super::Compilation; -use serialize::json; +use rustc_serialize::json; use std::any::Any; use std::env; diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index b063176d3cafa..c5b80da55e2d0 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -56,7 +56,7 @@ extern crate rustc_traits; extern crate rustc_codegen_utils; extern crate rustc_typeck; extern crate scoped_tls; -extern crate serialize; +extern crate rustc_serialize; extern crate smallvec; #[macro_use] extern crate log; @@ -94,7 +94,7 @@ use rustc_metadata::dynamic_lib::DynamicLibrary; use rustc::util::common::{time, ErrorReported}; use rustc_codegen_utils::codegen_backend::CodegenBackend; -use serialize::json::ToJson; +use rustc_serialize::json::ToJson; use std::any::Any; use std::borrow::Cow; diff --git a/src/librustc_errors/Cargo.toml b/src/librustc_errors/Cargo.toml index b24f8ddf4d9f7..c025146464d84 100644 --- a/src/librustc_errors/Cargo.toml +++ b/src/librustc_errors/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["dylib"] [dependencies] log = "0.4" -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } syntax_pos = { path = "../libsyntax_pos" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_cratesio_shim = { path = "../librustc_cratesio_shim" } diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 0fb77a7a3ab52..bf7211c68e89b 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -26,7 +26,7 @@ extern crate libc; #[macro_use] extern crate log; extern crate rustc_data_structures; -extern crate serialize as rustc_serialize; +extern crate rustc_serialize; extern crate syntax_pos; extern crate unicode_width; diff --git a/src/librustc_incremental/Cargo.toml b/src/librustc_incremental/Cargo.toml index b8519ee1ab1a5..b82259653488f 100644 --- a/src/librustc_incremental/Cargo.toml +++ b/src/librustc_incremental/Cargo.toml @@ -14,7 +14,7 @@ log = "0.4" rand = "0.5" rustc = { path = "../librustc" } rustc_data_structures = { path = "../librustc_data_structures" } -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } rustc_fs_util = { path = "../librustc_fs_util" } diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs index d0897a9618276..7261ab03d2af7 100644 --- a/src/librustc_incremental/lib.rs +++ b/src/librustc_incremental/lib.rs @@ -22,7 +22,7 @@ extern crate graphviz; #[macro_use] extern crate rustc; extern crate rustc_data_structures; -extern crate serialize as rustc_serialize; +extern crate rustc_serialize; extern crate rand; extern crate rustc_fs_util; diff --git a/src/librustc_metadata/Cargo.toml b/src/librustc_metadata/Cargo.toml index 337c87c24ba2b..47f41409735e0 100644 --- a/src/librustc_metadata/Cargo.toml +++ b/src/librustc_metadata/Cargo.toml @@ -16,7 +16,7 @@ rustc = { path = "../librustc" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_errors = { path = "../librustc_errors" } rustc_target = { path = "../librustc_target" } -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } stable_deref_trait = "1.0.0" syntax = { path = "../libsyntax" } syntax_ext = { path = "../libsyntax_ext" } diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index ee99f7465b905..4bf9709131aee 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -35,7 +35,7 @@ extern crate stable_deref_trait; extern crate syntax; extern crate syntax_pos; extern crate flate2; -extern crate serialize as rustc_serialize; // used by deriving +extern crate rustc_serialize; // used by deriving extern crate rustc_errors as errors; extern crate syntax_ext; extern crate proc_macro; diff --git a/src/librustc_metadata/schema.rs b/src/librustc_metadata/schema.rs index e91d15b78c075..fdf1c5bc72d6d 100644 --- a/src/librustc_metadata/schema.rs +++ b/src/librustc_metadata/schema.rs @@ -22,7 +22,7 @@ use rustc::ty::{self, Ty, ReprOptions}; use rustc_target::spec::{PanicStrategy, TargetTriple}; use rustc_data_structures::svh::Svh; -use rustc_serialize as serialize; +use rustc_serialize; use syntax::{ast, attr}; use syntax::edition::Edition; use syntax::symbol::Symbol; @@ -98,8 +98,8 @@ impl Clone for Lazy { } } -impl serialize::UseSpecializedEncodable for Lazy {} -impl serialize::UseSpecializedDecodable for Lazy {} +impl rustc_serialize::UseSpecializedEncodable for Lazy {} +impl rustc_serialize::UseSpecializedDecodable for Lazy {} impl HashStable for Lazy { fn hash_stable(&self, @@ -155,8 +155,8 @@ impl Clone for LazySeq { } } -impl serialize::UseSpecializedEncodable for LazySeq {} -impl serialize::UseSpecializedDecodable for LazySeq {} +impl rustc_serialize::UseSpecializedEncodable for LazySeq {} +impl rustc_serialize::UseSpecializedDecodable for LazySeq {} impl HashStable for LazySeq { fn hash_stable(&self, diff --git a/src/librustc_mir/Cargo.toml b/src/librustc_mir/Cargo.toml index 2da0ede9d15ce..dccbe10d0e756 100644 --- a/src/librustc_mir/Cargo.toml +++ b/src/librustc_mir/Cargo.toml @@ -20,7 +20,7 @@ rustc = { path = "../librustc" } rustc_target = { path = "../librustc_target" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_errors = { path = "../librustc_errors" } -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } byteorder = { version = "1.1", features = ["i128"] } diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 1a35f4da20bf1..2614d75b711d2 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -52,7 +52,7 @@ extern crate polonius_engine; #[macro_use] extern crate rustc; #[macro_use] extern crate rustc_data_structures; -extern crate serialize as rustc_serialize; +extern crate rustc_serialize; extern crate rustc_errors; #[macro_use] extern crate syntax; diff --git a/src/libserialize/Cargo.toml b/src/librustc_serialize/Cargo.toml similarity index 79% rename from src/libserialize/Cargo.toml rename to src/librustc_serialize/Cargo.toml index 66140d9c01f82..53a1370361139 100644 --- a/src/libserialize/Cargo.toml +++ b/src/librustc_serialize/Cargo.toml @@ -1,10 +1,10 @@ [package] authors = ["The Rust Project Developers"] -name = "serialize" +name = "rustc_serialize" version = "0.0.0" [lib] -name = "serialize" +name = "rustc_serialize" path = "lib.rs" crate-type = ["dylib", "rlib"] diff --git a/src/libserialize/collection_impls.rs b/src/librustc_serialize/collection_impls.rs similarity index 100% rename from src/libserialize/collection_impls.rs rename to src/librustc_serialize/collection_impls.rs diff --git a/src/libserialize/hex.rs b/src/librustc_serialize/hex.rs similarity index 97% rename from src/libserialize/hex.rs rename to src/librustc_serialize/hex.rs index 5604729d2f8dc..c70dbe47385fb 100644 --- a/src/libserialize/hex.rs +++ b/src/librustc_serialize/hex.rs @@ -32,8 +32,8 @@ impl ToHex for [u8] { /// ``` /// #![feature(rustc_private)] /// - /// extern crate serialize; - /// use serialize::hex::ToHex; + /// extern crate rustc_serialize; + /// use rustc_serialize::hex::ToHex; /// /// fn main () { /// let str = [52,32].to_hex(); @@ -103,8 +103,8 @@ impl FromHex for str { /// ``` /// #![feature(rustc_private)] /// - /// extern crate serialize; - /// use serialize::hex::{FromHex, ToHex}; + /// extern crate rustc_serialize; + /// use rustc_serialize::hex::{FromHex, ToHex}; /// /// fn main () { /// let hello_str = "Hello, World".as_bytes().to_hex(); diff --git a/src/libserialize/json.rs b/src/librustc_serialize/json.rs similarity index 99% rename from src/libserialize/json.rs rename to src/librustc_serialize/json.rs index 9439dc78d3ca4..b88cb9e4d6d46 100644 --- a/src/libserialize/json.rs +++ b/src/librustc_serialize/json.rs @@ -57,8 +57,8 @@ //! //! Rust provides a mechanism for low boilerplate encoding & decoding of values to and from JSON via //! the serialization API. -//! To be able to encode a piece of data, it must implement the `serialize::RustcEncodable` trait. -//! To be able to decode a piece of data, it must implement the `serialize::RustcDecodable` trait. +//! To be able to encode a piece of data, it must implement the `rustc_serialize::Encodable` trait. +//! To be able to decode a piece of data, it must implement the `rustc_serialize::Decodable` trait. //! The Rust compiler provides an annotation to automatically generate the code for these traits: //! `#[derive(RustcDecodable, RustcEncodable)]` //! @@ -78,7 +78,7 @@ //! //! ```rust //! # #![feature(rustc_private)] -//! extern crate serialize as rustc_serialize; // for the deriving below +//! extern crate rustc_serialize; // for the deriving below //! use rustc_serialize::json; //! //! // Automatically generate `Decodable` and `Encodable` trait implementations @@ -113,8 +113,8 @@ //! //! ```rust //! # #![feature(rustc_private)] -//! extern crate serialize; -//! use serialize::json::{self, ToJson, Json}; +//! extern crate rustc_serialize; +//! use rustc_serialize::json::{self, ToJson, Json}; //! //! // A custom data structure //! struct ComplexNum { @@ -155,7 +155,7 @@ //! # #![feature(rustc_private)] //! extern crate serialize; //! use std::collections::BTreeMap; -//! use serialize::json::{self, Json, ToJson}; +//! use rustc_serialize::json::{self, Json, ToJson}; //! //! // Only generate `Decodable` trait implementation //! #[derive(Decodable)] diff --git a/src/libserialize/leb128.rs b/src/librustc_serialize/leb128.rs similarity index 100% rename from src/libserialize/leb128.rs rename to src/librustc_serialize/leb128.rs diff --git a/src/libserialize/lib.rs b/src/librustc_serialize/lib.rs similarity index 96% rename from src/libserialize/lib.rs rename to src/librustc_serialize/lib.rs index 98b48ef291857..c7c9e447a3cdb 100644 --- a/src/libserialize/lib.rs +++ b/src/librustc_serialize/lib.rs @@ -42,7 +42,3 @@ pub mod json; pub mod opaque; pub mod leb128; - -mod rustc_serialize { - pub use serialize::*; -} diff --git a/src/libserialize/opaque.rs b/src/librustc_serialize/opaque.rs similarity index 99% rename from src/libserialize/opaque.rs rename to src/librustc_serialize/opaque.rs index 4ce80bc36a080..ecf32e8a3cc81 100644 --- a/src/libserialize/opaque.rs +++ b/src/librustc_serialize/opaque.rs @@ -337,7 +337,7 @@ impl<'a> serialize::Decoder for Decoder<'a> { #[cfg(test)] mod tests { - use serialize::{Encodable, Decodable}; + use rustc_serialize::{Encodable, Decodable}; use std::fmt::Debug; use super::{Encoder, Decoder}; diff --git a/src/libserialize/serialize.rs b/src/librustc_serialize/serialize.rs similarity index 100% rename from src/libserialize/serialize.rs rename to src/librustc_serialize/serialize.rs diff --git a/src/librustc_target/Cargo.toml b/src/librustc_target/Cargo.toml index dfdd7f0ae58e5..d40857bd9311d 100644 --- a/src/librustc_target/Cargo.toml +++ b/src/librustc_target/Cargo.toml @@ -13,4 +13,4 @@ bitflags = "1.0" log = "0.4" rustc_cratesio_shim = { path = "../librustc_cratesio_shim" } rustc_data_structures = { path = "../librustc_data_structures" } -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } diff --git a/src/librustc_target/lib.rs b/src/librustc_target/lib.rs index 813b39de06413..d156a12f2a97b 100644 --- a/src/librustc_target/lib.rs +++ b/src/librustc_target/lib.rs @@ -29,10 +29,9 @@ #[macro_use] extern crate bitflags; -extern crate serialize; #[macro_use] extern crate log; -extern crate serialize as rustc_serialize; // used by deriving +extern crate rustc_serialize; // used by deriving // See librustc_cratesio_shim/Cargo.toml for a comment explaining this. #[allow(unused_extern_crates)] diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs index 3285ccfd6c12d..2ce0154dbb46b 100644 --- a/src/librustc_target/spec/mod.rs +++ b/src/librustc_target/spec/mod.rs @@ -44,7 +44,7 @@ //! the target's settings, though `target-feature` and `link-args` will *add* //! to the list specified by the target, rather than replace. -use serialize::json::{Json, ToJson}; +use rustc_serialize::json::{Json, ToJson}; use std::collections::BTreeMap; use std::default::Default; use std::{fmt, io}; @@ -264,7 +264,7 @@ macro_rules! supported_targets { #[cfg(test)] mod test_json_encode_decode { - use serialize::json::ToJson; + use rustc_serialize::json::ToJson; use super::Target; $(use super::$module;)* @@ -1096,7 +1096,7 @@ impl Target { pub fn search(target_triple: &TargetTriple) -> Result { use std::env; use std::fs; - use serialize::json; + use rustc_serialize::json; fn load_file(path: &Path) -> Result { let contents = fs::read(path).map_err(|e| e.to_string())?; diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index b46efb20d8f6b..8db0217260a2f 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -53,7 +53,7 @@ use std::sync::Arc; use std::rc::Rc; use errors; -use serialize::json::{ToJson, Json, as_json}; +use rustc_serialize::json::{ToJson, Json, as_json}; use syntax::ast; use syntax::ext::base::MacroKind; use syntax::source_map::FileName; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 4b043b26d8650..bcd23a0d88570 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -40,7 +40,6 @@ extern crate rustc_lint; extern crate rustc_metadata; extern crate rustc_target; extern crate rustc_typeck; -extern crate serialize; #[macro_use] extern crate syntax; extern crate syntax_pos; extern crate test as testing; @@ -51,7 +50,7 @@ extern crate tempfile; extern crate minifier; extern crate parking_lot; -extern crate serialize as rustc_serialize; // used by deriving +extern crate rustc_serialize; // used by deriving use std::default::Default; use std::env; diff --git a/src/libsyntax/Cargo.toml b/src/libsyntax/Cargo.toml index 519cc7aa92c55..d5895ed9bfe60 100644 --- a/src/libsyntax/Cargo.toml +++ b/src/libsyntax/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["dylib"] [dependencies] bitflags = "1.0" -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } log = "0.4" scoped-tls = "0.1" syntax_pos = { path = "../libsyntax_pos" } diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 227017a9073fe..324ca15d087a3 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -30,7 +30,7 @@ use ThinVec; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::sync::Lrc; -use serialize::{self, Decoder, Encoder}; +use rustc_serialize::{self, Decoder, Encoder}; use std::fmt; pub use rustc_target::abi::FloatTy; @@ -242,13 +242,13 @@ impl fmt::Display for NodeId { } } -impl serialize::UseSpecializedEncodable for NodeId { +impl rustc_serialize::UseSpecializedEncodable for NodeId { fn default_encode(&self, s: &mut S) -> Result<(), S::Error> { s.emit_u32(self.as_u32()) } } -impl serialize::UseSpecializedDecodable for NodeId { +impl rustc_serialize::UseSpecializedDecodable for NodeId { fn default_decode(d: &mut D) -> Result { d.read_u32().map(NodeId::from_u32) } @@ -2321,12 +2321,12 @@ impl ForeignItemKind { #[cfg(test)] mod tests { use super::*; - use serialize; + use rustc_serialize; // are ASTs encodable? #[test] fn check_asts_encodable() { - fn assert_encodable() {} + fn assert_encodable() {} assert_encodable::(); } } diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index ca9c5ad7b600e..dd21b3aef2119 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -33,7 +33,6 @@ #[macro_use] extern crate bitflags; extern crate core; -extern crate serialize; #[macro_use] extern crate log; pub extern crate rustc_errors as errors; extern crate syntax_pos; @@ -43,7 +42,7 @@ extern crate rustc_target; #[macro_use] extern crate smallvec; -extern crate serialize as rustc_serialize; // used by deriving +extern crate rustc_serialize; // used by deriving use rustc_data_structures::sync::Lock; use rustc_data_structures::bit_set::GrowableBitSet; diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 46fc6454d1c3b..1ae56c3dcc371 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -18,7 +18,7 @@ use ast::{self}; use parse::ParseSess; use print::pprust; use ptr::P; -use serialize::{Decodable, Decoder, Encodable, Encoder}; +use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use symbol::keywords; use syntax::parse::parse_stream_from_source_str; use syntax_pos::{self, Span, FileName}; diff --git a/src/libsyntax/ptr.rs b/src/libsyntax/ptr.rs index 9fbc64758da4d..c825111281a94 100644 --- a/src/libsyntax/ptr.rs +++ b/src/libsyntax/ptr.rs @@ -41,7 +41,7 @@ use std::iter::FromIterator; use std::ops::{Deref, DerefMut}; use std::{mem, ptr, slice, vec}; -use serialize::{Encodable, Decodable, Encoder, Decoder}; +use rustc_serialize::{Encodable, Decodable, Encoder, Decoder}; use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult, HashStable}; diff --git a/src/libsyntax/tokenstream.rs b/src/libsyntax/tokenstream.rs index 242299f1b1f6f..077bd38d63245 100644 --- a/src/libsyntax/tokenstream.rs +++ b/src/libsyntax/tokenstream.rs @@ -28,7 +28,7 @@ use ext::tt::{macro_parser, quoted}; use parse::Directory; use parse::token::{self, DelimToken, Token}; use print::pprust; -use serialize::{Decoder, Decodable, Encoder, Encodable}; +use rustc_serialize::{Decoder, Decodable, Encoder, Encodable}; use util::RcVec; use std::borrow::Cow; diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index a5b12ce4c4d83..a44ae552397e3 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -224,7 +224,7 @@ pub struct TraitDef<'a> { /// other than the current trait pub additional_bounds: Vec>, - /// Any extra lifetimes and/or bounds, e.g. `D: serialize::Decoder` + /// Any extra lifetimes and/or bounds, e.g. `D: rustc_serialize::Decoder` pub generics: LifetimeBounds<'a>, /// Is it an `unsafe` trait? diff --git a/src/libsyntax_pos/Cargo.toml b/src/libsyntax_pos/Cargo.toml index 08ee2e0f37626..15ecef2f38427 100644 --- a/src/libsyntax_pos/Cargo.toml +++ b/src/libsyntax_pos/Cargo.toml @@ -9,7 +9,7 @@ path = "lib.rs" crate-type = ["dylib"] [dependencies] -serialize = { path = "../libserialize" } +rustc_serialize = { path = "../librustc_serialize" } rustc_data_structures = { path = "../librustc_data_structures" } arena = { path = "../libarena" } scoped-tls = { version = "0.1.1", features = ["nightly"] } diff --git a/src/libsyntax_pos/hygiene.rs b/src/libsyntax_pos/hygiene.rs index bc52a3e1c7c29..744b41aad2411 100644 --- a/src/libsyntax_pos/hygiene.rs +++ b/src/libsyntax_pos/hygiene.rs @@ -20,7 +20,7 @@ use Span; use edition::Edition; use symbol::Symbol; -use serialize::{Encodable, Decodable, Encoder, Decoder}; +use rustc_serialize::{Encodable, Decodable, Encoder, Decoder}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use std::fmt; diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index 34fb71e4ddf68..ec858f58b3aff 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -44,10 +44,9 @@ extern crate rustc_data_structures; #[macro_use] extern crate scoped_tls; -use serialize::{Encodable, Decodable, Encoder, Decoder}; +use rustc_serialize::{Encodable, Decodable, Encoder, Decoder}; -extern crate serialize; -extern crate serialize as rustc_serialize; // used by deriving +extern crate rustc_serialize; // used by deriving #[macro_use] extern crate cfg_if; @@ -541,7 +540,7 @@ impl Default for Span { } } -impl serialize::UseSpecializedEncodable for Span { +impl rustc_serialize::UseSpecializedEncodable for Span { fn default_encode(&self, s: &mut S) -> Result<(), S::Error> { let span = self.data(); s.emit_struct("Span", 2, |s| { @@ -556,7 +555,7 @@ impl serialize::UseSpecializedEncodable for Span { } } -impl serialize::UseSpecializedDecodable for Span { +impl rustc_serialize::UseSpecializedDecodable for Span { fn default_decode(d: &mut D) -> Result { d.read_struct("Span", 2, |d| { let lo = d.read_struct_field("lo", 0, Decodable::decode)?; diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs index 741877bb4c88f..f4d6cefbe904a 100644 --- a/src/libsyntax_pos/symbol.rs +++ b/src/libsyntax_pos/symbol.rs @@ -17,7 +17,7 @@ use {Span, DUMMY_SP, GLOBALS}; use rustc_data_structures::fx::FxHashMap; use arena::DroplessArena; -use serialize::{Decodable, Decoder, Encodable, Encoder}; +use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use std::fmt; use std::str; use std::cmp::{PartialEq, Ordering, PartialOrd, Ord}; diff --git a/src/libtest/formatters/json.rs b/src/libtest/formatters/json.rs index 3c803ad82337f..90a4cc67ae1f3 100644 --- a/src/libtest/formatters/json.rs +++ b/src/libtest/formatters/json.rs @@ -151,7 +151,7 @@ impl OutputFormatter for JsonFormatter { } /// A formatting utility used to print strings with characters in need of escaping. -/// Base code taken form `libserialize::json::escape_str` +/// Base code taken form `librustc_serialize::json::escape_str` struct EscapedString>(S); impl> ::std::fmt::Display for EscapedString { diff --git a/src/test/run-make-fulldeps/pretty-expanded/input.rs b/src/test/run-make-fulldeps/pretty-expanded/input.rs index 04bf17dc28aec..088280a4b6f0d 100644 --- a/src/test/run-make-fulldeps/pretty-expanded/input.rs +++ b/src/test/run-make-fulldeps/pretty-expanded/input.rs @@ -12,7 +12,7 @@ // #13544 -extern crate serialize; +extern crate rustc_serialize; #[derive(Encodable)] pub struct A; #[derive(Encodable)] pub struct B(isize); diff --git a/src/test/run-make-fulldeps/save-analysis-fail/foo.rs b/src/test/run-make-fulldeps/save-analysis-fail/foo.rs index b844f2e49e71e..ff49085140b03 100644 --- a/src/test/run-make-fulldeps/save-analysis-fail/foo.rs +++ b/src/test/run-make-fulldeps/save-analysis-fail/foo.rs @@ -433,7 +433,7 @@ impl Error + 'static + Send { ::is::(self) } } -extern crate serialize; +extern crate rustc_serialize; #[derive(Clone, Copy, Hash, Encodable, Decodable, PartialEq, Eq, PartialOrd, Ord, Debug, Default)] struct AllDerives(i32); diff --git a/src/test/run-make-fulldeps/save-analysis/foo.rs b/src/test/run-make-fulldeps/save-analysis/foo.rs index 5b4e4802957af..8fe9a9b9b5d44 100644 --- a/src/test/run-make-fulldeps/save-analysis/foo.rs +++ b/src/test/run-make-fulldeps/save-analysis/foo.rs @@ -428,7 +428,7 @@ impl Error + 'static + Send { ::is::(self) } } -extern crate serialize; +extern crate rustc_serialize; #[derive(Clone, Copy, Hash, Encodable, Decodable, PartialEq, Eq, PartialOrd, Ord, Debug, Default)] struct AllDerives(i32); diff --git a/src/test/run-pass-fulldeps/derive-no-std-not-supported.rs b/src/test/run-pass-fulldeps/derive-no-std-not-supported.rs index 1e42355f83421..2bc95002548f2 100644 --- a/src/test/run-pass-fulldeps/derive-no-std-not-supported.rs +++ b/src/test/run-pass-fulldeps/derive-no-std-not-supported.rs @@ -12,7 +12,7 @@ #![feature(rustc_private)] #![no_std] -extern crate serialize as rustc_serialize; +extern crate rustc_serialize; #[derive(RustcEncodable)] struct Bar { diff --git a/src/test/run-pass-fulldeps/deriving-encodable-decodable-box.rs b/src/test/run-pass-fulldeps/deriving-encodable-decodable-box.rs index 8b56ade21f955..2d61c3510d852 100644 --- a/src/test/run-pass-fulldeps/deriving-encodable-decodable-box.rs +++ b/src/test/run-pass-fulldeps/deriving-encodable-decodable-box.rs @@ -13,11 +13,11 @@ #![feature(box_syntax)] #![feature(rustc_private)] -extern crate serialize; -use serialize as rustc_serialize; +extern crate rustc_serialize; +use rustc_serialize; -use serialize::{Encodable, Decodable}; -use serialize::json; +use rustc_serialize::{Encodable, Decodable}; +use rustc_serialize::json; #[derive(RustcEncodable, RustcDecodable)] struct A { diff --git a/src/test/run-pass-fulldeps/deriving-encodable-decodable-cell-refcell.rs b/src/test/run-pass-fulldeps/deriving-encodable-decodable-cell-refcell.rs index 15edd4d49508e..5021528a09734 100644 --- a/src/test/run-pass-fulldeps/deriving-encodable-decodable-cell-refcell.rs +++ b/src/test/run-pass-fulldeps/deriving-encodable-decodable-cell-refcell.rs @@ -15,12 +15,12 @@ #![feature(rustc_private)] -extern crate serialize; -use serialize as rustc_serialize; +extern crate rustc_serialize; +use rustc_serialize; use std::cell::{Cell, RefCell}; -use serialize::{Encodable, Decodable}; -use serialize::json; +use rustc_serialize::{Encodable, Decodable}; +use rustc_serialize::json; #[derive(RustcEncodable, RustcDecodable)] struct A { diff --git a/src/test/run-pass-fulldeps/deriving-global.rs b/src/test/run-pass-fulldeps/deriving-global.rs index b95c947d21587..f27e52e98b4ab 100644 --- a/src/test/run-pass-fulldeps/deriving-global.rs +++ b/src/test/run-pass-fulldeps/deriving-global.rs @@ -10,8 +10,8 @@ #![feature(rustc_private)] -extern crate serialize; -use serialize as rustc_serialize; +extern crate rustc_serialize; +use rustc_serialize; mod submod { // if any of these are implemented without global calls for any diff --git a/src/test/run-pass-fulldeps/deriving-hygiene.rs b/src/test/run-pass-fulldeps/deriving-hygiene.rs index 1deeb24243714..294a06dd5f825 100644 --- a/src/test/run-pass-fulldeps/deriving-hygiene.rs +++ b/src/test/run-pass-fulldeps/deriving-hygiene.rs @@ -10,8 +10,8 @@ #![allow(non_upper_case_globals)] #![feature(rustc_private)] -extern crate serialize; -use serialize as rustc_serialize; +extern crate rustc_serialize; +use rustc_serialize; pub const other: u8 = 1; pub const f: u8 = 1; diff --git a/src/test/run-pass-fulldeps/empty-struct-braces-derive.rs b/src/test/run-pass-fulldeps/empty-struct-braces-derive.rs index 79ce3cb68d4be..8c61e218d7916 100644 --- a/src/test/run-pass-fulldeps/empty-struct-braces-derive.rs +++ b/src/test/run-pass-fulldeps/empty-struct-braces-derive.rs @@ -12,7 +12,7 @@ #![feature(rustc_private)] -extern crate serialize as rustc_serialize; +extern crate rustc_serialize; #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Debug, RustcEncodable, RustcDecodable)] diff --git a/src/test/run-pass-fulldeps/extern-mod-syntax.rs b/src/test/run-pass-fulldeps/extern-mod-syntax.rs index 37404ee7e696c..8bfc8f8050b14 100644 --- a/src/test/run-pass-fulldeps/extern-mod-syntax.rs +++ b/src/test/run-pass-fulldeps/extern-mod-syntax.rs @@ -11,8 +11,8 @@ #![allow(unused_imports)] #![feature(rustc_private)] -extern crate serialize; -use serialize::json::Object; +extern crate rustc_serialize; +use rustc_serialize::json::Object; pub fn main() { println!("Hello world!"); diff --git a/src/test/run-pass-fulldeps/issue-11881.rs b/src/test/run-pass-fulldeps/issue-11881.rs index 5121ecd6cf311..01b88f8470927 100644 --- a/src/test/run-pass-fulldeps/issue-11881.rs +++ b/src/test/run-pass-fulldeps/issue-11881.rs @@ -14,17 +14,17 @@ #![feature(rustc_private)] -extern crate serialize; -use serialize as rustc_serialize; +extern crate rustc_serialize; +use rustc_serialize; use std::io::Cursor; use std::io::prelude::*; use std::fmt; use std::slice; -use serialize::{Encodable, Encoder}; -use serialize::json; -use serialize::opaque; +use rustc_serialize::{Encodable, Encoder}; +use rustc_serialize::json; +use rustc_serialize::opaque; #[derive(RustcEncodable)] struct Foo { diff --git a/src/test/run-pass-fulldeps/issue-14021.rs b/src/test/run-pass-fulldeps/issue-14021.rs index 5426dd94637a6..53573ab2f47b8 100644 --- a/src/test/run-pass-fulldeps/issue-14021.rs +++ b/src/test/run-pass-fulldeps/issue-14021.rs @@ -12,11 +12,11 @@ #![allow(unused_imports)] #![feature(rustc_private)] -extern crate serialize; -extern crate serialize as rustc_serialize; +extern crate rustc_serialize; +extern crate rustc_serialize; -use serialize::{Encodable, Decodable}; -use serialize::json; +use rustc_serialize::{Encodable, Decodable}; +use rustc_serialize::json; #[derive(RustcEncodable, RustcDecodable, PartialEq, Debug)] struct UnitLikeStruct; diff --git a/src/test/run-pass-fulldeps/issue-15924.rs b/src/test/run-pass-fulldeps/issue-15924.rs index 717a35707b415..d3ee0da729b80 100644 --- a/src/test/run-pass-fulldeps/issue-15924.rs +++ b/src/test/run-pass-fulldeps/issue-15924.rs @@ -14,11 +14,11 @@ #![feature(rustc_private)] -extern crate serialize; +extern crate rustc_serialize; use std::fmt; -use serialize::{Encoder, Encodable}; -use serialize::json; +use rustc_serialize::{Encoder, Encodable}; +use rustc_serialize::json; struct Foo { v: T, diff --git a/src/test/run-pass-fulldeps/issue-24972.rs b/src/test/run-pass-fulldeps/issue-24972.rs index 6abdf98bb3844..78d939567ad89 100644 --- a/src/test/run-pass-fulldeps/issue-24972.rs +++ b/src/test/run-pass-fulldeps/issue-24972.rs @@ -11,9 +11,9 @@ #![allow(dead_code)] #![feature(rustc_private)] -extern crate serialize; +extern crate rustc_serialize; -use serialize::{Encodable, Decodable}; +use rustc_serialize::{Encodable, Decodable}; use std::fmt::Display; pub trait Entity : Decodable + Encodable + Sized { diff --git a/src/test/run-pass-fulldeps/issue-2804.rs b/src/test/run-pass-fulldeps/issue-2804.rs index 2e1104afae031..904946554bed9 100644 --- a/src/test/run-pass-fulldeps/issue-2804.rs +++ b/src/test/run-pass-fulldeps/issue-2804.rs @@ -12,10 +12,10 @@ #![allow(dead_code)] #![feature(rustc_private)] -extern crate serialize; +extern crate rustc_serialize; use std::collections::HashMap; -use serialize::json::{self, Json}; +use rustc_serialize::json::{self, Json}; use std::option; enum object { diff --git a/src/test/run-pass-fulldeps/issue-4016.rs b/src/test/run-pass-fulldeps/issue-4016.rs index 2d72b42a5bd7b..ec650b4a573aa 100644 --- a/src/test/run-pass-fulldeps/issue-4016.rs +++ b/src/test/run-pass-fulldeps/issue-4016.rs @@ -12,9 +12,9 @@ #![feature(rustc_private)] -extern crate serialize; +extern crate rustc_serialize; -use serialize::{json, Decodable}; +use rustc_serialize::{json, Decodable}; trait JD : Decodable {} diff --git a/src/test/run-pass-fulldeps/issue-4036.rs b/src/test/run-pass-fulldeps/issue-4036.rs index ae7bb8a684224..8217d56fcb23a 100644 --- a/src/test/run-pass-fulldeps/issue-4036.rs +++ b/src/test/run-pass-fulldeps/issue-4036.rs @@ -16,9 +16,9 @@ #![feature(rustc_private)] -extern crate serialize; +extern crate rustc_serialize; -use serialize::{json, Decodable}; +use rustc_serialize::{json, Decodable}; pub fn main() { let json = json::from_str("[1]").unwrap(); diff --git a/src/test/run-pass-fulldeps/rustc_encodable_hygiene.rs b/src/test/run-pass-fulldeps/rustc_encodable_hygiene.rs index 655b08225ab39..3d62749b7ab6a 100644 --- a/src/test/run-pass-fulldeps/rustc_encodable_hygiene.rs +++ b/src/test/run-pass-fulldeps/rustc_encodable_hygiene.rs @@ -12,7 +12,7 @@ #[allow(dead_code)] -extern crate serialize as rustc_serialize; +extern crate rustc_serialize; #[derive(RustcDecodable, RustcEncodable,Debug)] struct A { diff --git a/src/test/ui-fulldeps/deprecated-derive.rs b/src/test/ui-fulldeps/deprecated-derive.rs index a728523d83267..8728aec12b8fc 100644 --- a/src/test/ui-fulldeps/deprecated-derive.rs +++ b/src/test/ui-fulldeps/deprecated-derive.rs @@ -13,7 +13,7 @@ #![feature(rustc_private)] #![allow(dead_code)] -extern crate serialize; +extern crate rustc_serialize as serialize; #[derive(Encodable)] //~^ WARNING derive(Encodable) is deprecated in favor of derive(RustcEncodable) diff --git a/src/tools/error_index_generator/main.rs b/src/tools/error_index_generator/main.rs index a5556e1d570eb..1df34f2aaff70 100644 --- a/src/tools/error_index_generator/main.rs +++ b/src/tools/error_index_generator/main.rs @@ -13,7 +13,7 @@ extern crate env_logger; extern crate syntax; extern crate rustdoc; -extern crate serialize as rustc_serialize; +extern crate rustc_serialize; use std::collections::BTreeMap; use std::env;