Skip to content

serialize: Fully deprecate the library in-tree #20033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ extern crate collections;
#[phase(plugin, link)] extern crate log;
#[phase(plugin, link)] extern crate syntax;

extern crate "serialize" as rustc_serialize; // used by deriving

#[cfg(test)]
extern crate test;

Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use syntax::ast_util::local_def;

use std::cell::RefCell;

#[deriving(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
pub enum Def {
DefFn(ast::DefId, bool /* is_ctor */),
DefStaticMethod(/* method */ ast::DefId, MethodProvenance),
Expand Down Expand Up @@ -73,13 +73,13 @@ pub struct Export {
pub def_id: ast::DefId, // The definition of the target.
}

#[deriving(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
pub enum MethodProvenance {
FromTrait(ast::DefId),
FromImpl(ast::DefId),
}

#[deriving(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
pub enum TyParamProvenance {
FromSelf(ast::DefId),
FromParam(ast::DefId),
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/middle/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ use syntax::visit::{Visitor, FnKind};
/// placate the same deriving in `ty::FreeRegion`, but we may want to
/// actually attach a more meaningful ordering to scopes than the one
/// generated via deriving here.
#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash, Encodable, Decodable, Show)]
#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable,
RustcDecodable, Show, Copy)]
pub enum CodeExtent {
Misc(ast::NodeId)
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/resolve_lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use syntax::visit;
use syntax::visit::Visitor;
use util::nodemap::NodeMap;

#[deriving(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Show)]
#[deriving(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)]
pub enum DefRegion {
DefStaticRegion,
DefEarlyBoundRegion(/* space */ subst::ParamSpace,
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/subst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ impl RegionSubsts {
///////////////////////////////////////////////////////////////////////////
// ParamSpace

#[deriving(Copy, PartialOrd, Ord, PartialEq, Eq,
Clone, Hash, Encodable, Decodable, Show)]
#[deriving(PartialOrd, Ord, PartialEq, Eq, Copy,
Clone, Hash, RustcEncodable, RustcDecodable, Show)]
pub enum ParamSpace {
TypeSpace, // Type parameters attached to a type definition, trait, or impl
SelfSpace, // Self parameter on a trait
Expand Down Expand Up @@ -224,7 +224,7 @@ impl ParamSpace {
/// Vector of things sorted by param space. Used to keep
/// the set of things declared on the type, self, or method
/// distinct.
#[deriving(PartialEq, Eq, Clone, Hash, Encodable, Decodable)]
#[deriving(PartialEq, Eq, Clone, Hash, RustcEncodable, RustcDecodable)]
pub struct VecPerParamSpace<T> {
// This was originally represented as a tuple with one Vec<T> for
// each variant of ParamSpace, and that remains the abstraction
Expand Down
35 changes: 19 additions & 16 deletions src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ pub struct mt<'tcx> {
pub mutbl: ast::Mutability,
}

#[deriving(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Show)]
#[deriving(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)]
pub enum TraitStore {
/// Box<Trait>
UniqTraitStore,
Expand Down Expand Up @@ -277,13 +277,13 @@ pub enum ast_ty_to_ty_cache_entry<'tcx> {
atttce_resolved(Ty<'tcx>) /* resolved to a type, irrespective of region */
}

#[deriving(Clone, PartialEq, Decodable, Encodable)]
#[deriving(Clone, PartialEq, RustcDecodable, RustcEncodable)]
pub struct ItemVariances {
pub types: VecPerParamSpace<Variance>,
pub regions: VecPerParamSpace<Variance>,
}

#[deriving(Clone, Copy, PartialEq, Decodable, Encodable, Show)]
#[deriving(Clone, PartialEq, RustcDecodable, RustcEncodable, Show, Copy)]
pub enum Variance {
Covariant, // T<A> <: T<B> iff A <: B -- e.g., function return type
Invariant, // T<A> <: T<B> iff B == A -- e.g., type of mutable cell
Expand Down Expand Up @@ -430,7 +430,7 @@ pub fn type_of_adjust<'tcx>(cx: &ctxt<'tcx>, adj: &AutoAdjustment<'tcx>) -> Opti
}
}

#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, PartialOrd, Show)]
#[deriving(Clone, Copy, RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Show)]
pub struct param_index {
pub space: subst::ParamSpace,
pub index: uint
Expand Down Expand Up @@ -510,7 +510,7 @@ pub struct MethodCall {
pub adjustment: ExprAdjustment
}

#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show, Encodable, Decodable)]
#[deriving(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)]
pub enum ExprAdjustment {
NoAdjustment,
AutoDeref(uint),
Expand Down Expand Up @@ -973,15 +973,15 @@ pub struct ParamTy {
/// is the outer fn.
///
/// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Show)]
#[deriving(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)]
pub struct DebruijnIndex {
// We maintain the invariant that this is never 0. So 1 indicates
// the innermost binder. To ensure this, create with `DebruijnIndex::new`.
pub depth: uint,
}

/// Representation of regions:
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Show)]
#[deriving(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)]
pub enum Region {
// Region bound in a type or fn declaration which will be
// substituted 'early' -- that is, at the same time when type
Expand Down Expand Up @@ -1028,7 +1028,7 @@ pub struct UpvarId {
pub closure_expr_id: ast::NodeId,
}

#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show, Encodable, Decodable)]
#[deriving(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)]
pub enum BorrowKind {
/// Data must be immutable and is aliasable.
ImmBorrow,
Expand Down Expand Up @@ -1121,7 +1121,7 @@ pub enum BorrowKind {
/// - Through mutation, the borrowed upvars can actually escape
/// the closure, so sometimes it is necessary for them to be larger
/// than the closure lifetime itself.
#[deriving(Copy, PartialEq, Clone, Encodable, Decodable, Show)]
#[deriving(PartialEq, Clone, RustcEncodable, RustcDecodable, Show, Copy)]
pub struct UpvarBorrow {
pub kind: BorrowKind,
pub region: ty::Region,
Expand All @@ -1146,15 +1146,17 @@ impl Region {
}
}

#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash, Encodable, Decodable, Show)]
#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash,
RustcEncodable, RustcDecodable, Show, Copy)]
/// A "free" region `fr` can be interpreted as "some region
/// at least as big as the scope `fr.scope`".
pub struct FreeRegion {
pub scope: region::CodeExtent,
pub bound_region: BoundRegion
}

#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash, Encodable, Decodable, Show)]
#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash,
RustcEncodable, RustcDecodable, Show, Copy)]
pub enum BoundRegion {
/// An anonymous region parameter for a given fn (&T)
BrAnon(uint),
Expand Down Expand Up @@ -1412,7 +1414,8 @@ pub struct ExistentialBounds {

pub type BuiltinBounds = EnumSet<BuiltinBound>;

#[deriving(Copy, Clone, Encodable, PartialEq, Eq, Decodable, Hash, Show)]
#[deriving(Clone, RustcEncodable, PartialEq, Eq, RustcDecodable, Hash,
Show, Copy)]
#[repr(uint)]
pub enum BuiltinBound {
BoundSend,
Expand Down Expand Up @@ -1463,7 +1466,7 @@ pub struct FloatVid {
pub index: uint
}

#[deriving(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash)]
#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
pub struct RegionVid {
pub index: uint
}
Expand All @@ -1485,7 +1488,7 @@ pub enum InferTy {
FreshIntTy(uint),
}

#[deriving(Clone, Copy, Encodable, Decodable, Eq, Hash, Show)]
#[deriving(Clone, RustcEncodable, RustcDecodable, Eq, Hash, Show, Copy)]
pub enum InferRegion {
ReVar(RegionVid),
ReSkolemized(uint, BoundRegion)
Expand Down Expand Up @@ -1571,7 +1574,7 @@ pub struct TypeParameterDef<'tcx> {
pub default: Option<Ty<'tcx>>,
}

#[deriving(Encodable, Decodable, Clone, Show)]
#[deriving(RustcEncodable, RustcDecodable, Clone, Show)]
pub struct RegionParameterDef {
pub name: ast::Name,
pub def_id: ast::DefId,
Expand Down Expand Up @@ -6223,7 +6226,7 @@ pub fn accumulate_lifetimes_in_type(accumulator: &mut Vec<ty::Region>,
}

/// A free variable referred to in a function.
#[deriving(Copy, Encodable, Decodable)]
#[deriving(Copy, RustcEncodable, RustcDecodable)]
pub struct Freevar {
/// The variable being accessed free.
pub def: def::Def,
Expand Down
Loading