rustc_macros = { path = "../librustc_macros" }
rustc_data_structures = { path = "../librustc_data_structures" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
backtrace = "0.3.3"
use crate::ty::{self, TyCtxt};
use crate::hir::map::definitions::FIRST_FREE_DEF_INDEX;
use rustc_data_structures::indexed_vec::Idx;
-use serialize;
use std::fmt;
use std::u32;
}
}
-impl serialize::UseSpecializedEncodable for CrateNum {}
-impl serialize::UseSpecializedDecodable for CrateNum {}
+impl rustc_serialize::UseSpecializedEncodable for CrateNum {}
+impl rustc_serialize::UseSpecializedDecodable for CrateNum {}
newtype_index! {
/// A DefIndex is an index into the hir-map for a crate, identifying a
}
}
-impl serialize::UseSpecializedEncodable for DefIndex {}
-impl serialize::UseSpecializedDecodable for DefIndex {}
+impl rustc_serialize::UseSpecializedEncodable for DefIndex {}
+impl rustc_serialize::UseSpecializedDecodable for DefIndex {}
/// A `DefId` identifies a particular *definition*, by combining a crate
/// index and a def index.
}
}
-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
}
}
-impl serialize::UseSpecializedEncodable for LocalDefId {}
-impl serialize::UseSpecializedDecodable for LocalDefId {}
+impl rustc_serialize::UseSpecializedEncodable for LocalDefId {}
+impl rustc_serialize::UseSpecializedDecodable for LocalDefId {}
use rustc_data_structures::thin_vec::ThinVec;
use rustc_macros::HashStable;
-use serialize::{self, Encoder, Encodable, Decoder, Decodable};
+use rustc_serialize::{self, Encoder, Encodable, Decoder, Decodable};
use std::collections::{BTreeSet, BTreeMap};
use std::fmt;
use smallvec::SmallVec;
}
}
-impl serialize::UseSpecializedEncodable for HirId {
+impl rustc_serialize::UseSpecializedEncodable for HirId {
fn default_encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
let HirId {
owner,
}
}
-impl serialize::UseSpecializedDecodable for HirId {
+impl rustc_serialize::UseSpecializedDecodable for HirId {
fn default_decode<D: Decoder>(d: &mut D) -> Result<HirId, D::Error> {
let owner = DefIndex::decode(d)?;
let local_id = ItemLocalId::decode(d)?;
use std::ops::Deref;
use std::{slice, vec};
-use serialize::{Encodable, Decodable, Encoder, Decoder};
+use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult,
HashStable};
use crate::mir::interpret::ConstValue;
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_macros::HashStable;
-use serialize::UseSpecializedDecodable;
+use rustc_serialize::UseSpecializedDecodable;
use smallvec::SmallVec;
use std::ops::Index;
use syntax::source_map::Span;
extern crate libc;
#[macro_use] extern crate rustc_macros;
#[macro_use] extern crate rustc_data_structures;
-
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
-
-// FIXME: This import is used by deriving `RustcDecodable` and `RustcEncodable`. Removing this
-// results in a bunch of "failed to resolve" errors. Hopefully, the compiler moves to serde or
-// something, and we can get rid of this.
-#[allow(rust_2018_idioms)]
-extern crate serialize as rustc_serialize;
-
#[macro_use] extern crate smallvec;
// Use the test crate here so we depend on getopts through it. This allow tools to link to both
use crate::lint::builtin::BuiltinLintDiagnostics;
use crate::lint::levels::{LintLevelSets, LintLevelsBuilder};
use crate::middle::privacy::AccessLevels;
-use crate::rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
+use rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
use crate::session::{config, early_error, Session};
use crate::ty::{self, print::Printer, subst::Kind, TyCtxt, Ty};
use crate::ty::layout::{LayoutError, LayoutOf, TyLayout};
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::sync::{RwLock, MappedReadGuard, ReadGuard};
-use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
- StableHasherResult};
+use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableHasherResult};
+use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
use crate::ich::StableHashingContext;
use crate::mir::{Body, BasicBlock};
-use crate::rustc_serialize as serialize;
-
#[derive(Clone, Debug)]
pub struct Cache {
predecessors: RwLock<Option<IndexVec<BasicBlock, Vec<BasicBlock>>>>
}
-impl serialize::Encodable for Cache {
- fn encode<S: serialize::Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
- serialize::Encodable::encode(&(), s)
+impl rustc_serialize::Encodable for Cache {
+ fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
+ Encodable::encode(&(), s)
}
}
-impl serialize::Decodable for Cache {
- fn decode<D: serialize::Decoder>(d: &mut D) -> Result<Self, D::Error> {
- serialize::Decodable::decode(d).map(|_v: ()| Self::new())
+impl rustc_serialize::Decodable for Cache {
+ fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error> {
+ Decodable::decode(d).map(|_v: ()| Self::new())
}
}
}
}
-impl<'tcx> ::serialize::UseSpecializedDecodable for &'tcx Allocation {}
+impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx Allocation {}
/// Byte accessors
impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
use crate::ty::{self, TyCtxt, Instance, subst::UnpackedKind};
use crate::ty::layout::{self, Size};
use std::io;
-use crate::rustc_serialize::{Encoder, Decodable, Encodable};
+use rustc_serialize::{Encoder, Decodable, Encodable};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::{Lock as Mutex, HashMapExt};
use rustc_data_structures::tiny_list::TinyList;
#[derive(Copy, Clone, Eq, Hash, Ord, PartialEq, PartialOrd, Debug)]
pub struct AllocId(pub u64);
-impl crate::rustc_serialize::UseSpecializedEncodable for AllocId {}
-impl crate::rustc_serialize::UseSpecializedDecodable for AllocId {}
+impl rustc_serialize::UseSpecializedEncodable for AllocId {}
+impl rustc_serialize::UseSpecializedDecodable for AllocId {}
#[derive(RustcDecodable, RustcEncodable)]
enum AllocDiscriminant {
use crate::hir::{self, InlineAsm as HirInlineAsm};
use crate::mir::interpret::{ConstValue, InterpError, Scalar};
use crate::mir::visit::MirVisitable;
-use crate::rustc_serialize as serialize;
use crate::ty::adjustment::PointerCast;
use crate::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor};
use crate::ty::layout::VariantIdx;
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::sync::MappedReadGuard;
use rustc_macros::HashStable;
+use rustc_serialize::{Encodable, Decodable};
use smallvec::SmallVec;
use std::borrow::Cow;
use std::fmt::{self, Debug, Display, Formatter, Write};
}
}
-impl<T: serialize::Encodable> serialize::UseSpecializedEncodable for ClearCrossCrate<T> {}
-impl<T: serialize::Decodable> serialize::UseSpecializedDecodable for ClearCrossCrate<T> {}
+impl<T: Encodable> rustc_serialize::UseSpecializedEncodable for ClearCrossCrate<T> {}
+impl<T: Decodable> rustc_serialize::UseSpecializedDecodable for ClearCrossCrate<T> {}
/// Grouped information about the source code origin of a MIR entity.
/// Intended to be inspected by diagnostics and debuginfo.
use crate::hir::def_id::{DefId, CrateNum};
use crate::infer::canonical::{CanonicalVarInfo, CanonicalVarInfos};
use rustc_data_structures::fx::FxHashMap;
-use crate::rustc_serialize::{Decodable, Decoder, Encoder, Encodable, opaque};
+use rustc_serialize::{Decodable, Decoder, Encoder, Encodable, opaque};
use std::hash::Hash;
use std::intrinsics;
use crate::ty::{self, Ty, TyCtxt};
use $crate::ty::codec::*;
use $crate::ty::subst::SubstsRef;
use $crate::hir::def_id::{CrateNum};
- use crate::rustc_serialize::{Decoder, SpecializedDecoder};
+ use rustc_serialize::{Decoder, SpecializedDecoder};
use std::borrow::Cow;
impl<$($typaram ),*> Decoder for $DecoderName<$($typaram),*> {
use arena::SyncDroplessArena;
use crate::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;
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<'tcx> = Canonical<'tcx, Ty<'tcx>>;
}
}
-impl<'tcx> serialize::UseSpecializedDecodable for &'tcx List<Ty<'tcx>> {}
+impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx List<Ty<'tcx>> {}
impl<T> List<T> {
#[inline(always)]
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<'tcx> GenericPredicates<'tcx> {
pub fn instantiate(
}
}
-impl<'tcx> serialize::UseSpecializedEncodable for &'tcx AdtDef {
+impl<'tcx> rustc_serialize::UseSpecializedEncodable for &'tcx AdtDef {
fn default_encode<S: Encoder>(&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<StableHashingContext<'a>> for AdtDef {
use crate::ich::{CachingSourceMapView, Fingerprint};
use crate::mir::{self, interpret};
use crate::mir::interpret::{AllocDecodingSession, AllocDecodingState};
-use crate::rustc_serialize::{Decodable, Decoder, Encodable, Encoder, opaque,
+use rustc_serialize::{Decodable, Decoder, Encodable, Encoder, opaque,
SpecializedDecoder, SpecializedEncoder,
UseSpecializedDecodable, UseSpecializedEncodable};
use crate::session::{CrateDisambiguator, Session};
use syntax::ast::{self, Ident};
use syntax::symbol::{kw, InternedString};
-use serialize;
use self::InferTy::*;
use self::TyKind::*;
}
}
-impl<'tcx> serialize::UseSpecializedDecodable for &'tcx List<ExistentialPredicate<'tcx>> {}
+impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx List<ExistentialPredicate<'tcx>> {}
impl<'tcx> List<ExistentialPredicate<'tcx>> {
/// Returns the "principal def id" of this set of existential predicates.
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 {
}
}
-impl<'tcx> serialize::UseSpecializedDecodable for &'tcx Const<'tcx> {}
+impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx Const<'tcx> {}
/// An inference variable for a const, for use in const generics.
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd,
use crate::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor};
use crate::mir::interpret::ConstValue;
-use serialize::{self, Encodable, Encoder, Decodable, Decoder};
+use rustc_serialize::{self, Encodable, Encoder, Decodable, Decoder};
use syntax_pos::{Span, DUMMY_SP};
use smallvec::SmallVec;
use rustc_macros::HashStable;
}
}
-impl<'tcx> serialize::UseSpecializedDecodable for SubstsRef<'tcx> {}
+impl<'tcx> rustc_serialize::UseSpecializedDecodable for SubstsRef<'tcx> {}
///////////////////////////////////////////////////////////////////////////
// Public trait `Subst`
parking_lot = "0.7"
tempfile = "3.0.5"
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
rustc = { path = "../librustc" }
LinkerPluginLto, Lto};
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.
use std::path::Path;
use std::str;
-use serialize::leb128;
+use rustc_serialize::leb128;
// https://webassembly.github.io/spec/core/binary/modules.html#binary-importsec
const WASM_CUSTOM_SECTION_ID: u8 = 0;
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"] }
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);
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)
}
+use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
+
use std::fmt::Debug;
use std::iter::{self, FromIterator};
use std::slice;
use std::vec;
use std::u32;
-use rustc_serialize as serialize;
-
/// Represents some newtyped `usize` wrapper.
///
/// Purpose: avoid mixing indexes for different bitvector domains.
);
(@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)
}
}
);
// 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 }
})
}
#[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]
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;
rustc_codegen_utils = { path = "../librustc_codegen_utils" }
rustc_typeck = { path = "../librustc_typeck" }
rustc_interface = { path = "../librustc_interface" }
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
syntax_ext = { path = "../libsyntax_ext" }
use rustc_interface::util::get_codegen_sysroot;
use rustc_data_structures::sync::SeqCst;
-use serialize::json::ToJson;
+use rustc_serialize::json::ToJson;
use std::borrow::Cow;
use std::cmp::max;
[dependencies]
log = "0.4"
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax_pos = { path = "../libsyntax_pos" }
rustc_data_structures = { path = "../librustc_data_structures" }
unicode-width = "0.1.4"
#![deny(rust_2018_idioms)]
#![deny(unused_lifetimes)]
-#[allow(unused_extern_crates)]
-extern crate serialize as rustc_serialize; // used by deriving
-
pub use emitter::ColorConfig;
use Level::*;
rand = "0.6"
rustc = { path = "../librustc" }
rustc_data_structures = { path = "../librustc_data_structures" }
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
rustc_fs_util = { path = "../librustc_fs_util" }
#![deny(unused_lifetimes)]
#[macro_use] extern crate rustc;
-#[allow(unused_extern_crates)]
-extern crate serialize as rustc_serialize; // used by deriving
-
#[macro_use] extern crate log;
mod assert_dep_graph;
syntax = { path = "../libsyntax" }
syntax_ext = { path = "../libsyntax_ext" }
syntax_pos = { path = "../libsyntax_pos" }
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
rustc = { path = "../librustc" }
rustc_allocator = { path = "../librustc_allocator" }
rustc_ast_borrowck = { path = "../librustc_ast_borrowck" }
use syntax_pos::{FileName, edition::Edition, hygiene};
use syntax_ext;
-use serialize::json;
+use rustc_serialize::json;
use tempfile::Builder as TempFileBuilder;
use std::any::Any;
use rustc::dep_graph::DepGraph;
use rustc_passes::hir_stats;
use rustc_plugin::registry::Registry;
-use serialize::json;
+use rustc_serialize::json;
use std::cell::{Ref, RefMut, RefCell};
use std::ops::Deref;
use std::rc::Rc;
rustc_data_structures = { path = "../librustc_data_structures" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
rustc_target = { path = "../librustc_target" }
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
stable_deref_trait = "1.0.0"
syntax = { path = "../libsyntax" }
syntax_ext = { path = "../libsyntax_ext" }
#![deny(unused_lifetimes)]
extern crate libc;
-#[allow(unused_extern_crates)]
-extern crate serialize as rustc_serialize; // used by deriving
extern crate proc_macro;
#[macro_use]
use rustc_target::spec::{PanicStrategy, TargetTriple};
use rustc_data_structures::svh::Svh;
-use rustc_serialize as serialize;
use syntax::{ast, attr};
use syntax::edition::Edition;
use syntax::symbol::Symbol;
}
}
-impl<T> serialize::UseSpecializedEncodable for Lazy<T> {}
-impl<T> serialize::UseSpecializedDecodable for Lazy<T> {}
+impl<T> rustc_serialize::UseSpecializedEncodable for Lazy<T> {}
+impl<T> rustc_serialize::UseSpecializedDecodable for Lazy<T> {}
/// A sequence of type T referred to by its absolute position
/// in the metadata and length, and which can be decoded lazily.
}
}
-impl<T> serialize::UseSpecializedEncodable for LazySeq<T> {}
-impl<T> serialize::UseSpecializedDecodable for LazySeq<T> {}
+impl<T> rustc_serialize::UseSpecializedEncodable for LazySeq<T> {}
+impl<T> rustc_serialize::UseSpecializedDecodable for LazySeq<T> {}
/// Encoding / decoding state for `Lazy` and `LazySeq`.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
rustc_target = { path = "../librustc_target" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
byteorder = { version = "1.1", features = ["i128"] }
#![deny(unused_lifetimes)]
#[macro_use] extern crate log;
-#[macro_use]
-extern crate rustc;
+#[macro_use] extern crate rustc;
#[macro_use] extern crate rustc_data_structures;
-#[allow(unused_extern_crates)]
-extern crate serialize as rustc_serialize; // used by deriving
-#[macro_use]
-extern crate syntax;
+#[macro_use] extern crate syntax;
mod error_codes;
bitflags = "1.0"
log = "0.4"
rustc_data_structures = { path = "../librustc_data_structures" }
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax_pos = { path = "../libsyntax_pos" }
#[macro_use] extern crate log;
-#[allow(unused_extern_crates)]
-extern crate serialize as rustc_serialize; // used by deriving
-
pub mod abi;
pub mod spec;
//! 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};
#[cfg(test)]
mod test_json_encode_decode {
- use serialize::json::ToJson;
+ use rustc_serialize::json::ToJson;
use super::Target;
$(use super::$module;)+
pub fn search(target_triple: &TargetTriple) -> Result<Target, String> {
use std::env;
use std::fs;
- use serialize::json;
+ use rustc_serialize::json;
fn load_file(path: &Path) -> Result<Target, String> {
let contents = fs::read(path).map_err(|e| e.to_string())?;
-#[allow(unused_extern_crates)]
extern crate serialize as rustc_serialize;
use rustc_serialize::{Encodable, Decodable};
-#[allow(unused_extern_crates)]
extern crate serialize as rustc_serialize;
use rustc_serialize::{Encodable, Decodable};
[dependencies]
bitflags = "1.0"
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
log = "0.4"
scoped-tls = "1.0"
lazy_static = "1.0.0"
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;
}
}
-impl serialize::UseSpecializedEncodable for NodeId {
+impl rustc_serialize::UseSpecializedEncodable for NodeId {
fn default_encode<S: Encoder>(&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: Decoder>(d: &mut D) -> Result<NodeId, D::Error> {
d.read_u32().map(NodeId::from_u32)
}
#[cfg(test)]
mod tests {
use super::*;
- use serialize;
// Are ASTs encodable?
#[test]
fn check_asts_encodable() {
- fn assert_encodable<T: serialize::Encodable>() {}
+ fn assert_encodable<T: rustc_serialize::Encodable>() {}
assert_encodable::<Crate>();
}
}
#![recursion_limit="256"]
-#[allow(unused_extern_crates)]
-extern crate serialize as rustc_serialize; // used by deriving
-
pub use errors;
use rustc_data_structures::sync::Lock;
use rustc_data_structures::bit_set::GrowableBitSet;
use std::ops::{Deref, DerefMut};
use std::{slice, vec};
-use serialize::{Encodable, Decodable, Encoder, Decoder};
+use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult,
HashStable};
#[cfg(target_arch = "x86_64")]
use rustc_data_structures::static_assert_size;
use rustc_data_structures::sync::Lrc;
-use serialize::{Decoder, Decodable, Encoder, Encodable};
+use rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
use smallvec::{SmallVec, smallvec};
use std::borrow::Cow;
doctest = false
[dependencies]
-serialize = { path = "../libserialize" }
+rustc_serialize = { path = "../libserialize", package = "serialize" }
rustc_macros = { path = "../librustc_macros" }
rustc_data_structures = { path = "../librustc_data_structures" }
arena = { path = "../libarena" }
use crate::edition::Edition;
use crate::symbol::{kw, Symbol};
-use serialize::{Encodable, Decodable, Encoder, Decoder};
+use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use std::fmt;
#![feature(specialization)]
#![feature(step_trait)]
-use serialize::{Encodable, Decodable, Encoder, Decoder};
-
-#[allow(unused_extern_crates)]
-extern crate serialize as rustc_serialize; // used by deriving
+use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
pub mod edition;
use edition::Edition;
}
}
-impl serialize::UseSpecializedEncodable for Span {
+impl rustc_serialize::UseSpecializedEncodable for Span {
fn default_encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
let span = self.data();
s.emit_struct("Span", 2, |s| {
}
}
-impl serialize::UseSpecializedDecodable for Span {
+impl rustc_serialize::UseSpecializedDecodable for Span {
fn default_decode<D: Decoder>(d: &mut D) -> Result<Span, D::Error> {
d.read_struct("Span", 2, |d| {
let lo = d.read_struct_field("lo", 0, Decodable::decode)?;
use rustc_data_structures::indexed_vec::Idx;
use rustc_data_structures::newtype_index;
use rustc_macros::symbols;
-use serialize::{Decodable, Decoder, Encodable, Encoder};
+use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use std::cmp::{PartialEq, Ordering, PartialOrd, Ord};
use std::fmt;