diff options
Diffstat (limited to 'src/libsyntax')
33 files changed, 193 insertions, 193 deletions
diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index b1599cb807d..c366ced58b2 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -15,7 +15,7 @@ pub use self::AbiArchitecture::*; use std::fmt; -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Os { OsWindows, OsMacos, @@ -26,7 +26,7 @@ pub enum Os { OsDragonfly, } -#[deriving(PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Clone, Copy)] +#[derive(PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Clone, Copy)] pub enum Abi { // NB: This ordering MUST match the AbiDatas array below. // (This is ensured by the test indices_are_correct().) @@ -47,7 +47,7 @@ pub enum Abi { } #[allow(non_camel_case_types)] -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Architecture { X86, X86_64, @@ -56,7 +56,7 @@ pub enum Architecture { Mipsel } -#[deriving(Copy)] +#[derive(Copy)] pub struct AbiData { abi: Abi, @@ -64,7 +64,7 @@ pub struct AbiData { name: &'static str, } -#[deriving(Copy)] +#[derive(Copy)] pub enum AbiArchitecture { /// Not a real ABI (e.g., intrinsic) RustArch, diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index a705872b53d..01f66f3bbd0 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -79,7 +79,7 @@ use serialize::{Encodable, Decodable, Encoder, Decoder}; /// table) and a SyntaxContext to track renaming and /// macro expansion per Flatt et al., "Macros /// That Work Together" -#[deriving(Clone, Copy, Hash, PartialOrd, Eq, Ord)] +#[derive(Clone, Copy, Hash, PartialOrd, Eq, Ord)] pub struct Ident { pub name: Name, pub ctxt: SyntaxContext @@ -157,7 +157,7 @@ pub const ILLEGAL_CTXT : SyntaxContext = 1; /// A name is a part of an identifier, representing a string or gensym. It's /// the result of interning. -#[deriving(Eq, Ord, PartialEq, PartialOrd, Hash, +#[derive(Eq, Ord, PartialEq, PartialOrd, Hash, RustcEncodable, RustcDecodable, Clone, Copy)] pub struct Name(pub u32); @@ -197,7 +197,7 @@ impl<D: Decoder<E>, E> Decodable<D, E> for Ident { /// Function name (not all functions have names) pub type FnIdent = Option<Ident>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub struct Lifetime { pub id: NodeId, @@ -205,7 +205,7 @@ pub struct Lifetime { pub name: Name } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct LifetimeDef { pub lifetime: Lifetime, pub bounds: Vec<Lifetime> @@ -214,7 +214,7 @@ pub struct LifetimeDef { /// A "Path" is essentially Rust's notion of a name; for instance: /// std::cmp::PartialEq . It's represented as a sequence of identifiers, /// along with a bunch of supporting information. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Path { pub span: Span, /// A `::foo` path, is relative to the crate root rather than current @@ -226,7 +226,7 @@ pub struct Path { /// A segment of a path: an identifier, an optional lifetime, and a set of /// types. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct PathSegment { /// The identifier portion of this path segment. pub identifier: Ident, @@ -239,7 +239,7 @@ pub struct PathSegment { pub parameters: PathParameters, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum PathParameters { AngleBracketedParameters(AngleBracketedParameterData), ParenthesizedParameters(ParenthesizedParameterData), @@ -317,7 +317,7 @@ impl PathParameters { } /// A path like `Foo<'a, T>` -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct AngleBracketedParameterData { /// The lifetime parameters for this path segment. pub lifetimes: Vec<Lifetime>, @@ -335,7 +335,7 @@ impl AngleBracketedParameterData { } /// A path like `Foo(A,B) -> C` -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ParenthesizedParameterData { /// `(A,B)` pub inputs: Vec<P<Ty>>, @@ -348,7 +348,7 @@ pub type CrateNum = u32; pub type NodeId = u32; -#[deriving(Clone, Eq, Ord, PartialOrd, PartialEq, RustcEncodable, +#[derive(Clone, Eq, Ord, PartialOrd, PartialEq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub struct DefId { pub krate: CrateNum, @@ -369,7 +369,7 @@ pub const DUMMY_NODE_ID: NodeId = -1; /// typeck::collect::compute_bounds matches these against /// the "special" built-in traits (see middle::lang_items) and /// detects Copy, Send and Sync. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum TyParamBound { TraitTyParamBound(PolyTraitRef, TraitBoundModifier), RegionTyParamBound(Lifetime) @@ -377,7 +377,7 @@ pub enum TyParamBound { /// A modifier on a bound, currently this is only used for `?Sized`, where the /// modifier is `Maybe`. Negative bounds should also be handled here. -#[deriving(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum TraitBoundModifier { None, Maybe, @@ -385,7 +385,7 @@ pub enum TraitBoundModifier { pub type TyParamBounds = OwnedSlice<TyParamBound>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TyParam { pub ident: Ident, pub id: NodeId, @@ -396,7 +396,7 @@ pub struct TyParam { /// Represents lifetimes and type parameters attached to a declaration /// of a function, enum, trait, etc. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Generics { pub lifetimes: Vec<LifetimeDef>, pub ty_params: OwnedSlice<TyParam>, @@ -415,34 +415,34 @@ impl Generics { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct WhereClause { pub id: NodeId, pub predicates: Vec<WherePredicate>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum WherePredicate { BoundPredicate(WhereBoundPredicate), RegionPredicate(WhereRegionPredicate), EqPredicate(WhereEqPredicate) } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct WhereBoundPredicate { pub span: Span, pub bounded_ty: P<Ty>, pub bounds: OwnedSlice<TyParamBound>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct WhereRegionPredicate { pub span: Span, pub lifetime: Lifetime, pub bounds: Vec<Lifetime>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct WhereEqPredicate { pub id: NodeId, pub span: Span, @@ -454,7 +454,7 @@ pub struct WhereEqPredicate { /// used to drive conditional compilation pub type CrateConfig = Vec<P<MetaItem>> ; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Crate { pub module: Mod, pub attrs: Vec<Attribute>, @@ -465,7 +465,7 @@ pub struct Crate { pub type MetaItem = Spanned<MetaItem_>; -#[deriving(Clone, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum MetaItem_ { MetaWord(InternedString), MetaList(InternedString, Vec<P<MetaItem>>), @@ -497,7 +497,7 @@ impl PartialEq for MetaItem_ { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Block { pub view_items: Vec<ViewItem>, pub stmts: Vec<P<Stmt>>, @@ -507,27 +507,27 @@ pub struct Block { pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Pat { pub id: NodeId, pub node: Pat_, pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct FieldPat { pub ident: Ident, pub pat: P<Pat>, pub is_shorthand: bool, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum BindingMode { BindByRef(Mutability), BindByValue(Mutability), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum PatWildKind { /// Represents the wildcard pattern `_` PatWildSingle, @@ -536,7 +536,7 @@ pub enum PatWildKind { PatWildMulti, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Pat_ { /// Represents a wildcard pattern (either `_` or `..`) PatWild(PatWildKind), @@ -565,13 +565,13 @@ pub enum Pat_ { PatMac(Mac), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum Mutability { MutMutable, MutImmutable, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum BinOp { BiAdd, BiSub, @@ -593,7 +593,7 @@ pub enum BinOp { BiGt, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum UnOp { UnUniq, UnDeref, @@ -603,7 +603,7 @@ pub enum UnOp { pub type Stmt = Spanned<Stmt_>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Stmt_ { /// Could be an item or a local (let) binding: StmtDecl(P<Decl>, NodeId), @@ -617,7 +617,7 @@ pub enum Stmt_ { StmtMac(P<Mac>, MacStmtStyle), } -#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum MacStmtStyle { /// The macro statement had a trailing semicolon, e.g. `foo! { ... };` /// `foo!(...);`, `foo![...];` @@ -632,7 +632,7 @@ pub enum MacStmtStyle { /// Where a local declaration came from: either a true `let ... = /// ...;`, or one desugared from the pattern of a for loop. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum LocalSource { LocalLet, LocalFor, @@ -641,7 +641,7 @@ pub enum LocalSource { // FIXME (pending discussion of #1697, #2178...): local should really be // a refinement on pat. /// Local represents a `let` statement, e.g., `let <pat>:<ty> = <expr>;` -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Local { pub pat: P<Pat>, pub ty: Option<P<Ty>>, @@ -653,7 +653,7 @@ pub struct Local { pub type Decl = Spanned<Decl_>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Decl_ { /// A local (let) binding: DeclLocal(P<Local>), @@ -662,7 +662,7 @@ pub enum Decl_ { } /// represents one arm of a 'match' -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Arm { pub attrs: Vec<Attribute>, pub pats: Vec<P<Pat>>, @@ -670,7 +670,7 @@ pub struct Arm { pub body: P<Expr>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Field { pub ident: SpannedIdent, pub expr: P<Expr>, @@ -679,26 +679,26 @@ pub struct Field { pub type SpannedIdent = Spanned<Ident>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum BlockCheckMode { DefaultBlock, UnsafeBlock(UnsafeSource), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum UnsafeSource { CompilerGenerated, UserProvided, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Expr { pub id: NodeId, pub node: Expr_, pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Expr_ { /// First expr is the place; second expr is the value. ExprBox(Option<P<Expr>>, P<Expr>), @@ -760,28 +760,28 @@ pub enum Expr_ { /// <Vec<T> as SomeTrait>::SomeAssociatedItem /// ^~~~~ ^~~~~~~~~ ^~~~~~~~~~~~~~~~~~ /// self_type trait_name item_name -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct QPath { pub self_type: P<Ty>, pub trait_ref: P<TraitRef>, pub item_name: Ident, // FIXME(#20301) -- should use Name } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum MatchSource { Normal, IfLetDesugar { contains_else_clause: bool }, WhileLetDesugar, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum CaptureClause { CaptureByValue, CaptureByRef, } /// A delimited sequence of token trees -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Delimited { /// The type of delimiter pub delim: token::DelimToken, @@ -816,7 +816,7 @@ impl Delimited { } /// A sequence of token treesee -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct SequenceRepetition { /// The sequence of token trees pub tts: Vec<TokenTree>, @@ -830,7 +830,7 @@ pub struct SequenceRepetition { /// A Kleene-style [repetition operator](http://en.wikipedia.org/wiki/Kleene_star) /// for token sequences. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum KleeneOp { ZeroOrMore, OneOrMore, @@ -848,7 +848,7 @@ pub enum KleeneOp { /// /// The RHS of an MBE macro is the only place `SubstNt`s are substituted. /// Nothing special happens to misnamed or misplaced `SubstNt`s. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] #[doc="For macro invocations; parsing is delegated to the macro"] pub enum TokenTree { /// A single token @@ -938,14 +938,14 @@ pub type Mac = Spanned<Mac_>; /// is being invoked, and the vector of token-trees contains the source /// of the macro invocation. /// There's only one flavor, now, so this could presumably be simplified. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Mac_ { // NB: the additional ident for a macro_rules-style macro is actually // stored in the enclosing item. Oog. MacInvocTT(Path, Vec<TokenTree> , SyntaxContext), // new macro-invocation } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum StrStyle { CookedStr, RawStr(uint) @@ -953,7 +953,7 @@ pub enum StrStyle { pub type Lit = Spanned<Lit_>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum Sign { Minus, Plus @@ -969,7 +969,7 @@ impl<T> Sign where T: Int { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum LitIntType { SignedIntLit(IntTy, Sign), UnsignedIntLit(UintTy), @@ -986,7 +986,7 @@ impl LitIntType { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Lit_ { LitStr(InternedString, StrStyle), LitBinary(Rc<Vec<u8> >), @@ -1000,13 +1000,13 @@ pub enum Lit_ { // NB: If you change this, you'll probably want to change the corresponding // type structure in middle/ty.rs as well. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct MutTy { pub ty: P<Ty>, pub mutbl: Mutability, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TypeField { pub ident: Ident, pub mt: MutTy, @@ -1015,7 +1015,7 @@ pub struct TypeField { /// Represents a required method in a trait declaration, /// one without a default implementation -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TypeMethod { pub ident: Ident, pub attrs: Vec<Attribute>, @@ -1033,26 +1033,26 @@ pub struct TypeMethod { /// a default implementation A trait method is either required (meaning it /// doesn't have an implementation, just a signature) or provided (meaning it /// has a default implementation). -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum TraitItem { RequiredMethod(TypeMethod), ProvidedMethod(P<Method>), TypeTraitItem(P<AssociatedType>), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ImplItem { MethodImplItem(P<Method>), TypeImplItem(P<Typedef>), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct AssociatedType { pub attrs: Vec<Attribute>, pub ty_param: TyParam, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Typedef { pub id: NodeId, pub span: Span, @@ -1062,7 +1062,7 @@ pub struct Typedef { pub typ: P<Ty>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum IntTy { TyI, TyI8, @@ -1087,7 +1087,7 @@ impl IntTy { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum UintTy { TyU, TyU8, @@ -1112,7 +1112,7 @@ impl fmt::Show for UintTy { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum FloatTy { TyF32, TyF64, @@ -1133,7 +1133,7 @@ impl FloatTy { } // Bind a type to an associated type: `A=Foo`. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TypeBinding { pub id: NodeId, pub ident: Ident, @@ -1143,7 +1143,7 @@ pub struct TypeBinding { // NB PartialEq method appears below. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Ty { pub id: NodeId, pub node: Ty_, @@ -1151,7 +1151,7 @@ pub struct Ty { } /// Not represented directly in the AST, referred to by name through a ty_path. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum PrimTy { TyInt(IntTy), TyUint(UintTy), @@ -1161,7 +1161,7 @@ pub enum PrimTy { TyChar } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum Onceness { Once, Many @@ -1177,7 +1177,7 @@ impl fmt::Show for Onceness { } /// Represents the type of a closure -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ClosureTy { pub lifetimes: Vec<LifetimeDef>, pub unsafety: Unsafety, @@ -1186,7 +1186,7 @@ pub struct ClosureTy { pub bounds: TyParamBounds, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct BareFnTy { pub unsafety: Unsafety, pub abi: Abi, @@ -1194,7 +1194,7 @@ pub struct BareFnTy { pub decl: P<FnDecl> } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] /// The different kinds of types recognized by the compiler pub enum Ty_ { TyVec(P<Ty>), @@ -1229,13 +1229,13 @@ pub enum Ty_ { TyInfer, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum AsmDialect { AsmAtt, AsmIntel } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct InlineAsm { pub asm: InternedString, pub asm_str_style: StrStyle, @@ -1249,7 +1249,7 @@ pub struct InlineAsm { } /// represents an argument in a function header -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Arg { pub ty: P<Ty>, pub pat: P<Pat>, @@ -1277,14 +1277,14 @@ impl Arg { } /// represents the header (not the body) of a function declaration -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct FnDecl { pub inputs: Vec<Arg>, pub output: FunctionRetTy, pub variadic: bool } -#[deriving(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)] +#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)] pub enum Unsafety { Unsafe, Normal, @@ -1299,7 +1299,7 @@ impl fmt::Show for Unsafety { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum FunctionRetTy { /// Functions with return type ! that always /// raise an error or exit (i.e. never return to the caller) @@ -1318,7 +1318,7 @@ impl FunctionRetTy { } /// Represents the kind of 'self' associated with a method -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ExplicitSelf_ { /// No self SelfStatic, @@ -1332,7 +1332,7 @@ pub enum ExplicitSelf_ { pub type ExplicitSelf = Spanned<ExplicitSelf_>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Method { pub attrs: Vec<Attribute>, pub id: NodeId, @@ -1340,7 +1340,7 @@ pub struct Method { pub node: Method_, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Method_ { /// Represents a method declaration MethDecl(Ident, @@ -1355,7 +1355,7 @@ pub enum Method_ { MethMac(Mac), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Mod { /// A span from the first token past `{` to the last token until `}`. /// For `mod foo;`, the inner span ranges from the first token @@ -1365,31 +1365,31 @@ pub struct Mod { pub items: Vec<P<Item>>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ForeignMod { pub abi: Abi, pub view_items: Vec<ViewItem>, pub items: Vec<P<ForeignItem>>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct VariantArg { pub ty: P<Ty>, pub id: NodeId, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum VariantKind { TupleVariantKind(Vec<VariantArg>), StructVariantKind(P<StructDef>), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct EnumDef { pub variants: Vec<P<Variant>>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Variant_ { pub name: Ident, pub attrs: Vec<Attribute>, @@ -1401,7 +1401,7 @@ pub struct Variant_ { pub type Variant = Spanned<Variant_>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum PathListItem_ { PathListIdent { name: Ident, id: NodeId }, PathListMod { id: NodeId } @@ -1419,7 +1419,7 @@ pub type PathListItem = Spanned<PathListItem_>; pub type ViewPath = Spanned<ViewPath_>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ViewPath_ { /// `foo::bar::baz as quux` @@ -1436,7 +1436,7 @@ pub enum ViewPath_ { ViewPathList(Path, Vec<PathListItem> , NodeId) } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ViewItem { pub node: ViewItem_, pub attrs: Vec<Attribute>, @@ -1444,7 +1444,7 @@ pub struct ViewItem { pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ViewItem_ { /// Ident: name used to refer to this crate in the code /// optional (InternedString,StrStyle): if present, this is a location @@ -1460,17 +1460,17 @@ pub type Attribute = Spanned<Attribute_>; /// Distinguishes between Attributes that decorate items and Attributes that /// are contained as statements within items. These two cases need to be /// distinguished for pretty-printing. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum AttrStyle { AttrOuter, AttrInner, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub struct AttrId(pub uint); /// Doc-comments are promoted to attributes that have is_sugared_doc = true -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Attribute_ { pub id: AttrId, pub style: AttrStyle, @@ -1483,13 +1483,13 @@ pub struct Attribute_ { /// that the ref_id is for. The impl_id maps to the "self type" of this impl. /// If this impl is an ItemImpl, the impl_id is redundant (it could be the /// same as the impl's node id). -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TraitRef { pub path: Path, pub ref_id: NodeId, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct PolyTraitRef { /// The `'a` in `<'a> Foo<&'a T>` pub bound_lifetimes: Vec<LifetimeDef>, @@ -1498,7 +1498,7 @@ pub struct PolyTraitRef { pub trait_ref: TraitRef, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum Visibility { Public, Inherited, @@ -1513,7 +1513,7 @@ impl Visibility { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct StructField_ { pub kind: StructFieldKind, pub id: NodeId, @@ -1532,7 +1532,7 @@ impl StructField_ { pub type StructField = Spanned<StructField_>; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum StructFieldKind { NamedField(Ident, Visibility), /// Element of a tuple-like struct @@ -1548,7 +1548,7 @@ impl StructFieldKind { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct StructDef { /// Fields, not including ctor pub fields: Vec<StructField>, @@ -1561,7 +1561,7 @@ pub struct StructDef { FIXME (#3300): Should allow items to be anonymous. Right now we just use dummy names for anon items. */ -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Item { pub ident: Ident, pub attrs: Vec<Attribute>, @@ -1571,7 +1571,7 @@ pub struct Item { pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Item_ { ItemStatic(P<Ty>, Mutability, P<Expr>), ItemConst(P<Ty>, P<Expr>), @@ -1613,7 +1613,7 @@ impl Item_ { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ForeignItem { pub ident: Ident, pub attrs: Vec<Attribute>, @@ -1623,7 +1623,7 @@ pub struct ForeignItem { pub vis: Visibility, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ForeignItem_ { ForeignItemFn(P<FnDecl>, Generics), ForeignItemStatic(P<Ty>, /* is_mutbl */ bool), @@ -1638,7 +1638,7 @@ impl ForeignItem_ { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum UnboxedClosureKind { FnUnboxedClosureKind, FnMutUnboxedClosureKind, @@ -1648,7 +1648,7 @@ pub enum UnboxedClosureKind { /// The data we save and restore about an inlined item or method. This is not /// part of the AST that we parse from a file, but it becomes part of the tree /// that we trans. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum InlinedItem { IIItem(P<Item>), IITraitItem(DefId /* impl id */, TraitItem), diff --git a/src/libsyntax/ast_map/blocks.rs b/src/libsyntax/ast_map/blocks.rs index 7c89245f53e..53787d71eef 100644 --- a/src/libsyntax/ast_map/blocks.rs +++ b/src/libsyntax/ast_map/blocks.rs @@ -41,7 +41,7 @@ use visit; /// - The default implementation for a trait method. /// /// To construct one, use the `Code::from_node` function. -#[deriving(Copy)] +#[derive(Copy)] pub struct FnLikeNode<'a> { node: ast_map::Node<'a> } /// MaybeFnLike wraps a method that indicates if an object @@ -81,7 +81,7 @@ impl MaybeFnLike for ast::Expr { /// Carries either an FnLikeNode or a Block, as these are the two /// constructs that correspond to "code" (as in, something from which /// we can construct a control-flow graph). -#[deriving(Copy)] +#[derive(Copy)] pub enum Code<'a> { FnLikeCode(FnLikeNode<'a>), BlockCode(&'a Block), diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index ea61415d61f..c5dbd194e3e 100644 --- a/src/libsyntax/ast_map/mod.rs +++ b/src/libsyntax/ast_map/mod.rs @@ -32,7 +32,7 @@ use std::slice; pub mod blocks; -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum PathElem { PathMod(Name), PathName(Name) @@ -53,7 +53,7 @@ impl fmt::Show for PathElem { } } -#[deriving(Clone)] +#[derive(Clone)] struct LinkedPathNode<'a> { node: PathElem, next: LinkedPath<'a>, @@ -76,7 +76,7 @@ impl<'a> Iterator for LinkedPath<'a> { } // HACK(eddyb) move this into libstd (value wrapper for slice::Iter). -#[deriving(Clone)] +#[derive(Clone)] pub struct Values<'a, T:'a>(pub slice::Iter<'a, T>); impl<'a, T: Copy> Iterator for Values<'a, T> { @@ -104,7 +104,7 @@ pub fn path_to_string<PI: Iterator<Item=PathElem>>(path: PI) -> String { }).to_string() } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum Node<'ast> { NodeItem(&'ast Item), NodeForeignItem(&'ast ForeignItem), @@ -126,7 +126,7 @@ pub enum Node<'ast> { /// Represents an entry and its parent Node ID /// The odd layout is to bring down the total size. -#[deriving(Copy, Show)] +#[derive(Copy, Show)] enum MapEntry<'ast> { /// Placeholder for holes in the map. NotPresent, @@ -157,7 +157,7 @@ impl<'ast> Clone for MapEntry<'ast> { } } -#[deriving(Show)] +#[derive(Show)] struct InlinedParent { path: Vec<PathElem>, ii: InlinedItem diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index a8393ed9d39..4026da6cf8e 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -343,7 +343,7 @@ pub fn empty_generics() -> Generics { // ______________________________________________________________________ // Enumerating the IDs which appear in an AST -#[deriving(RustcEncodable, RustcDecodable, Show, Copy)] +#[derive(RustcEncodable, RustcDecodable, Show, Copy)] pub struct IdRange { pub min: NodeId, pub max: NodeId, diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 92818f06341..43e23f26e93 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -277,7 +277,7 @@ pub fn find_crate_name(attrs: &[Attribute]) -> Option<InternedString> { first_attr_value_str_by_name(attrs, "crate_name") } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum InlineAttr { InlineNone, InlineHint, @@ -340,14 +340,14 @@ pub fn cfg_matches(diagnostic: &SpanHandler, cfgs: &[P<MetaItem>], cfg: &ast::Me } /// Represents the #[deprecated="foo"] and friends attributes. -#[deriving(RustcEncodable,RustcDecodable,Clone,Show)] +#[derive(RustcEncodable,RustcDecodable,Clone,Show)] pub struct Stability { pub level: StabilityLevel, pub text: Option<InternedString> } /// The available stability levels. -#[deriving(RustcEncodable,RustcDecodable,PartialEq,PartialOrd,Clone,Show,Copy)] +#[derive(RustcEncodable,RustcDecodable,PartialEq,PartialOrd,Clone,Show,Copy)] pub enum StabilityLevel { Deprecated, Experimental, @@ -463,7 +463,7 @@ fn int_type_of_word(s: &str) -> Option<IntType> { } } -#[deriving(PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] +#[derive(PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] pub enum ReprAttr { ReprAny, ReprInt(Span, IntType), @@ -482,7 +482,7 @@ impl ReprAttr { } } -#[deriving(Eq, Hash, PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] +#[derive(Eq, Hash, PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] pub enum IntType { SignedInt(ast::IntTy), UnsignedInt(ast::UintTy) diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index eb011faa55d..2c7bbcb6faf 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -36,13 +36,13 @@ pub trait Pos { /// A byte offset. Keep this small (currently 32-bits), as AST contains /// a lot of them. -#[deriving(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Show)] pub struct BytePos(pub u32); /// A character offset. Because of multibyte utf8 characters, a byte offset /// is not equivalent to a character offset. The CodeMap will convert BytePos /// values to CharPos values as necessary. -#[deriving(Copy, PartialEq, Hash, PartialOrd, Show)] +#[derive(Copy, PartialEq, Hash, PartialOrd, Show)] pub struct CharPos(pub uint); // FIXME: Lots of boilerplate in these impls, but so far my attempts to fix @@ -94,7 +94,7 @@ impl Sub for CharPos { /// are *absolute* positions from the beginning of the codemap, not positions /// relative to FileMaps. Methods on the CodeMap can be used to relate spans back /// to the original source. -#[deriving(Clone, Copy, Show, Hash)] +#[derive(Clone, Copy, Show, Hash)] pub struct Span { pub lo: BytePos, pub hi: BytePos, @@ -105,7 +105,7 @@ pub struct Span { pub const DUMMY_SP: Span = Span { lo: BytePos(0), hi: BytePos(0), expn_id: NO_EXPANSION }; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub struct Spanned<T> { pub node: T, pub span: Span, @@ -188,15 +188,15 @@ pub struct FileMapAndLine { pub fm: Rc<FileMap>, pub line: uint } pub struct FileMapAndBytePos { pub fm: Rc<FileMap>, pub pos: BytePos } /// The syntax with which a macro was invoked. -#[deriving(Clone, Copy, Hash, Show)] +#[derive(Clone, Copy, Hash, Show)] pub enum MacroFormat { - /// e.g. #[deriving(...)] <item> + /// e.g. #[derive(...)] <item> MacroAttribute, /// e.g. `format!()` MacroBang } -#[deriving(Clone, Hash, Show)] +#[derive(Clone, Hash, Show)] pub struct NameAndSpan { /// The name of the macro that was invoked to create the thing /// with this Span. @@ -210,7 +210,7 @@ pub struct NameAndSpan { } /// Extra information for tracking macro expansion of spans -#[deriving(Hash, Show)] +#[derive(Hash, Show)] pub struct ExpnInfo { /// The location of the actual macro invocation, e.g. `let x = /// foo!();` @@ -231,7 +231,7 @@ pub struct ExpnInfo { pub callee: NameAndSpan } -#[deriving(PartialEq, Eq, Clone, Show, Hash, RustcEncodable, RustcDecodable, Copy)] +#[derive(PartialEq, Eq, Clone, Show, Hash, RustcEncodable, RustcDecodable, Copy)] pub struct ExpnId(u32); pub const NO_EXPANSION: ExpnId = ExpnId(-1); @@ -255,7 +255,7 @@ pub struct FileLines { } /// Identifies an offset of a multi-byte character in a FileMap -#[deriving(Copy)] +#[derive(Copy)] pub struct MultiByteChar { /// The absolute offset of the character in the CodeMap pub pos: BytePos, diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 88dfdf6e2d8..c19c06c3155 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -28,7 +28,7 @@ use term; /// maximum number of lines we will print for each error; arbitrary. static MAX_LINES: uint = 6u; -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub enum RenderSpan { /// A FullSpan renders with both with an initial line for the /// message, prefixed by file:linenum, followed by a summary of @@ -54,7 +54,7 @@ impl RenderSpan { } } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub enum ColorConfig { Auto, Always, @@ -71,12 +71,12 @@ pub trait Emitter { /// This structure is used to signify that a task has panicked with a fatal error /// from the diagnostics. You can use this with the `Any` trait to figure out /// how a rustc task died (if so desired). -#[deriving(Copy)] +#[derive(Copy)] pub struct FatalError; /// Signifies that the compiler died with an explicit call to `.bug` /// or `.span_bug` rather than a failed assertion, etc. -#[deriving(Copy)] +#[derive(Copy)] pub struct ExplicitBug; /// A span-handler is like a handler but also @@ -222,7 +222,7 @@ pub fn mk_handler(e: Box<Emitter + Send>) -> Handler { } } -#[deriving(Copy, PartialEq, Clone)] +#[derive(Copy, PartialEq, Clone)] pub enum Level { Bug, Fatal, diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index e56194c95cd..91cc8a24622 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -233,7 +233,7 @@ impl MacResult for MacItems { /// Fill-in macro expansion result, to allow compilation to continue /// after hitting errors. -#[deriving(Copy)] +#[derive(Copy)] pub struct DummyResult { expr_only: bool, span: Span @@ -311,7 +311,7 @@ pub enum SyntaxExtension { /// A syntax extension that is attached to an item and creates new items /// based upon it. /// - /// `#[deriving(...)]` is an `ItemDecorator`. + /// `#[derive(...)]` is an `ItemDecorator`. Decorator(Box<ItemDecorator + 'static>), /// A syntax extension that is attached to an item and modifies it diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs index 10e14e0c975..c02416bfbea 100644 --- a/src/libsyntax/ext/deriving/cmp/ord.rs +++ b/src/libsyntax/ext/deriving/cmp/ord.rs @@ -83,7 +83,7 @@ pub fn expand_deriving_ord<F>(cx: &mut ExtCtxt, trait_def.expand(cx, mitem, item, push) } -#[deriving(Copy)] +#[derive(Copy)] pub enum OrderingOp { PartialCmpOp, LtOp, LeOp, GtOp, GeOp, } diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs index 3c8d74c14ee..882136cb862 100644 --- a/src/libsyntax/ext/deriving/decodable.rs +++ b/src/libsyntax/ext/deriving/decodable.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! The compiler code necessary for `#[deriving(Decodable)]`. See encodable.rs for more. +//! The compiler code necessary for `#[derive(Decodable)]`. See encodable.rs for more. use ast; use ast::{MetaItem, Item, Expr, MutMutable}; diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs index 5829f34bccc..b2c929123d5 100644 --- a/src/libsyntax/ext/deriving/encodable.rs +++ b/src/libsyntax/ext/deriving/encodable.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! The compiler code necessary to implement the `#[deriving(Encodable)]` +//! The compiler code necessary to implement the `#[derive(Encodable)]` //! (and `Decodable`, in decodable.rs) extension. The idea here is that -//! type-defining items may be tagged with `#[deriving(Encodable, Decodable)]`. +//! type-defining items may be tagged with `#[derive(Encodable, Decodable)]`. //! //! For example, a type like: //! //! ```ignore -//! #[deriving(Encodable, Decodable)] +//! #[derive(Encodable, Decodable)] //! struct Node { id: uint } //! ``` //! @@ -49,7 +49,7 @@ //! references other non-built-in types. A type definition like: //! //! ```ignore -//! #[deriving(Encodable, Decodable)] +//! #[derive(Encodable, Decodable)] //! struct Spanned<T> { node: T, span: Span } //! ``` //! diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index 55443dedfca..8863de8757b 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -1174,7 +1174,7 @@ impl<'a> MethodDef<'a> { } } -#[deriving(PartialEq)] // dogfooding! +#[derive(PartialEq)] // dogfooding! enum StructType { Unknown, Record, Tuple } diff --git a/src/libsyntax/ext/deriving/generic/ty.rs b/src/libsyntax/ext/deriving/generic/ty.rs index 95bdd8b9ffd..a236fa33eb1 100644 --- a/src/libsyntax/ext/deriving/generic/ty.rs +++ b/src/libsyntax/ext/deriving/generic/ty.rs @@ -24,7 +24,7 @@ use parse::token::special_idents; use ptr::P; /// The types of pointers -#[deriving(Clone)] +#[derive(Clone)] pub enum PtrTy<'a> { /// &'lifetime mut Borrowed(Option<&'a str>, ast::Mutability), @@ -34,7 +34,7 @@ pub enum PtrTy<'a> { /// A path, e.g. `::std::option::Option::<int>` (global). Has support /// for type parameters and a lifetime. -#[deriving(Clone)] +#[derive(Clone)] pub struct Path<'a> { pub path: Vec<&'a str> , pub lifetime: Option<&'a str>, @@ -85,7 +85,7 @@ impl<'a> Path<'a> { } /// A type. Supports pointers, Self, and literals -#[deriving(Clone)] +#[derive(Clone)] pub enum Ty<'a> { Self, /// &/Box/ Ty @@ -217,7 +217,7 @@ fn mk_generics(lifetimes: Vec<ast::LifetimeDef>, ty_params: Vec<ast::TyParam>) } /// Lifetimes and bounds on type parameters -#[deriving(Clone)] +#[derive(Clone)] pub struct LifetimeBounds<'a> { pub lifetimes: Vec<(&'a str, Vec<&'a str>)>, pub bounds: Vec<(&'a str, Vec<Path<'a>>)>, diff --git a/src/libsyntax/ext/deriving/hash.rs b/src/libsyntax/ext/deriving/hash.rs index 9ad0ad16217..9ff42d85cfb 100644 --- a/src/libsyntax/ext/deriving/hash.rs +++ b/src/libsyntax/ext/deriving/hash.rs @@ -99,7 +99,7 @@ fn hash_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) } if stmts.len() == 0 { - cx.span_bug(trait_span, "#[deriving(Hash)] needs at least one field"); + cx.span_bug(trait_span, "#[derive(Hash)] needs at least one field"); } cx.expr_block(cx.block(trait_span, stmts, None)) diff --git a/src/libsyntax/ext/deriving/show.rs b/src/libsyntax/ext/deriving/show.rs index 2788c89676a..0513c75cf57 100644 --- a/src/libsyntax/ext/deriving/show.rs +++ b/src/libsyntax/ext/deriving/show.rs @@ -67,7 +67,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span, Struct(_) => substr.type_ident, EnumMatching(_, v, _) => v.node.name, EnumNonMatchingCollapsed(..) | StaticStruct(..) | StaticEnum(..) => { - cx.span_bug(span, "nonsensical .fields in `#[deriving(Show)]`") + cx.span_bug(span, "nonsensical .fields in `#[derive(Show)]`") } }; diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index dcf25a26e2c..e65ecc19ea1 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -802,7 +802,7 @@ fn expand_arm(arm: ast::Arm, fld: &mut MacroExpander) -> ast::Arm { /// A visitor that extracts the PatIdent (binding) paths /// from a given thingy and puts them in a mutable /// array -#[deriving(Clone)] +#[derive(Clone)] struct PatIdentFinder { ident_accumulator: Vec<ast::Ident> } @@ -1320,7 +1320,7 @@ mod test { // a visitor that extracts the paths // from a given thingy and puts them in a mutable // array (passed in to the traversal) - #[deriving(Clone)] + #[derive(Clone)] struct PathExprFinderContext { path_accumulator: Vec<ast::Path> , } diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index 500070a14d2..1f39555f496 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -24,7 +24,7 @@ use ptr::P; use std::collections::HashMap; use std::iter::repeat; -#[deriving(PartialEq)] +#[derive(PartialEq)] enum ArgumentType { Known(String), Unsigned diff --git a/src/libsyntax/ext/mtwt.rs b/src/libsyntax/ext/mtwt.rs index 6a296333fdb..bac82494f28 100644 --- a/src/libsyntax/ext/mtwt.rs +++ b/src/libsyntax/ext/mtwt.rs @@ -39,7 +39,7 @@ pub struct SCTable { rename_memo: RefCell<HashMap<(SyntaxContext,Ident,Name),SyntaxContext>>, } -#[deriving(PartialEq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(PartialEq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum SyntaxContext_ { EmptyCtxt, Mark (Mrk,SyntaxContext), @@ -312,7 +312,7 @@ mod tests { // because of the SCTable, I now need a tidy way of // creating syntax objects. Sigh. - #[deriving(Clone, PartialEq, Show)] + #[derive(Clone, PartialEq, Show)] enum TestSC { M(Mrk), R(Ident,Name) diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 65ecf701e8d..69e473055e8 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -103,7 +103,7 @@ use std::collections::hash_map::Entry::{Vacant, Occupied}; // To avoid costly uniqueness checks, we require that `MatchSeq` always has // a nonempty body. -#[deriving(Clone)] +#[derive(Clone)] enum TokenTreeOrTokenTreeVec { Tt(ast::TokenTree), TtSeq(Rc<Vec<ast::TokenTree>>), @@ -126,13 +126,13 @@ impl TokenTreeOrTokenTreeVec { } /// an unzipping of `TokenTree`s -#[deriving(Clone)] +#[derive(Clone)] struct MatcherTtFrame { elts: TokenTreeOrTokenTreeVec, idx: uint, } -#[deriving(Clone)] +#[derive(Clone)] pub struct MatcherPos { stack: Vec<MatcherTtFrame>, top_elts: TokenTreeOrTokenTreeVec, diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 8af5e952e9a..86e81ede8b0 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -24,7 +24,7 @@ use std::ops::Add; use std::collections::HashMap; ///an unzipping of `TokenTree`s -#[deriving(Clone)] +#[derive(Clone)] struct TtFrame { forest: TokenTree, idx: uint, @@ -32,7 +32,7 @@ struct TtFrame { sep: Option<Token>, } -#[deriving(Clone)] +#[derive(Clone)] pub struct TtReader<'a> { pub sp_diag: &'a SpanHandler, /// the unzipped tree: @@ -99,7 +99,7 @@ fn lookup_cur_matched(r: &TtReader, name: Ident) -> Option<Rc<NamedMatch>> { matched_opt.map(|s| lookup_cur_matched_by_matched(r, s)) } -#[deriving(Clone)] +#[derive(Clone)] enum LockstepIterSize { LisUnconstrained, LisConstraint(uint, Ident), diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 545856a27af..f75873ac1c0 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -107,7 +107,7 @@ enum Status { } /// A set of features to be used by later passes. -#[deriving(Copy)] +#[derive(Copy)] pub struct Features { pub default_type_params: bool, pub unboxed_closures: bool, diff --git a/src/libsyntax/owned_slice.rs b/src/libsyntax/owned_slice.rs index 38c26e89671..b87e2c6abbc 100644 --- a/src/libsyntax/owned_slice.rs +++ b/src/libsyntax/owned_slice.rs @@ -17,7 +17,7 @@ use serialize::{Encodable, Decodable, Encoder, Decoder}; /// A non-growable owned slice. This is a separate type to allow the /// representation to change. -#[deriving(Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct OwnedSlice<T> { data: Box<[T]> } diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index b8da8365f7e..0d5592b57b1 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -24,7 +24,7 @@ use std::str; use std::string::String; use std::uint; -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum CommentStyle { /// No code on either side of each line of the comment Isolated, @@ -36,7 +36,7 @@ pub enum CommentStyle { BlankLine, } -#[deriving(Clone)] +#[derive(Clone)] pub struct Comment { pub style: CommentStyle, pub lines: Vec<String>, @@ -327,7 +327,7 @@ fn consume_comment(rdr: &mut StringReader, debug!("<<< consume comment"); } -#[deriving(Clone)] +#[derive(Clone)] pub struct Literal { pub lit: String, pub pos: BytePos, diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 0f5ff33021c..46a124074c7 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -51,7 +51,7 @@ pub trait Reader { } } -#[deriving(Clone, PartialEq, Eq, Show)] +#[derive(Clone, PartialEq, Eq, Show)] pub struct TokenAndSpan { pub tok: token::Token, pub sp: Span, diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index e3c831c09ba..e1e456f880e 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -22,7 +22,7 @@ use parse::token; use ptr::P; /// The specific types of unsupported syntax -#[deriving(Copy, PartialEq, Eq, Hash)] +#[derive(Copy, PartialEq, Eq, Hash)] pub enum ObsoleteSyntax { ObsoleteOwnedType, ObsoleteOwnedExpr, diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 95badb5df25..c0444363d4e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -106,7 +106,7 @@ type ItemInfo = (Ident, Item_, Option<Vec<Attribute> >); /// How to parse a path. There are four different kinds of paths, all of which /// are parsed somewhat differently. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum PathParsingMode { /// A path with no type parameters; e.g. `foo::bar::Baz` NoTypesAllowed, @@ -119,7 +119,7 @@ pub enum PathParsingMode { } /// How to parse a bound, whether to allow bound modifiers such as `?`. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum BoundParsingMode { Bare, Modified, @@ -318,7 +318,7 @@ pub struct Parser<'a> { pub expected_tokens: Vec<TokenType>, } -#[deriving(PartialEq, Eq, Clone)] +#[derive(PartialEq, Eq, Clone)] pub enum TokenType { Token(token::Token), Operator, diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 2745b7e13e9..1df7e2893f6 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -30,7 +30,7 @@ use std::path::BytesContainer; use std::rc::Rc; #[allow(non_camel_case_types)] -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum BinOpToken { Plus, Minus, @@ -45,7 +45,7 @@ pub enum BinOpToken { } /// A delimeter token -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum DelimToken { /// A round parenthesis: `(` or `)` Paren, @@ -55,14 +55,14 @@ pub enum DelimToken { Brace, } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum IdentStyle { /// `::` follows the identifier with no whitespace in-between. ModName, Plain, } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum Lit { Byte(ast::Name), Char(ast::Name), @@ -88,7 +88,7 @@ impl Lit { } #[allow(non_camel_case_types)] -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show)] pub enum Token { /* Expression-operator symbols. */ Eq, @@ -336,7 +336,7 @@ impl Token { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash)] /// For interpolation during macro expansion. pub enum Nonterminal { NtItem(P<ast::Item>), @@ -432,7 +432,7 @@ macro_rules! declare_special_idents_and_keywords {( pub use self::Keyword::*; use ast; - #[deriving(Copy)] + #[derive(Copy)] pub enum Keyword { $( $sk_variant, )* $( $rk_variant, )* @@ -582,7 +582,7 @@ pub fn reset_ident_interner() { /// destroyed. In particular, they must not access string contents. This can /// be fixed in the future by just leaking all strings until task death /// somehow. -#[deriving(Clone, PartialEq, Hash, PartialOrd, Eq, Ord)] +#[derive(Clone, PartialEq, Hash, PartialOrd, Eq, Ord)] pub struct InternedString { string: RcStr, } diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index a15f1ca354b..11cefc8719b 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -67,25 +67,25 @@ use std::io; use std::string; use std::iter::repeat; -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum Breaks { Consistent, Inconsistent, } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct BreakToken { offset: int, blank_space: int } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct BeginToken { offset: int, breaks: Breaks } -#[deriving(Clone)] +#[derive(Clone)] pub enum Token { String(string::String, int), Break(BreakToken), @@ -148,13 +148,13 @@ pub fn buf_str(toks: Vec<Token>, s } -#[deriving(Copy)] +#[derive(Copy)] pub enum PrintStackBreak { Fits, Broken(Breaks), } -#[deriving(Copy)] +#[derive(Copy)] pub struct PrintStackElem { offset: int, pbreak: PrintStackBreak diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 8e5766bdacc..9702c79719c 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -46,12 +46,12 @@ pub trait PpAnn { fn post(&self, _state: &mut State, _node: AnnNode) -> IoResult<()> { Ok(()) } } -#[deriving(Copy)] +#[derive(Copy)] pub struct NoAnn; impl PpAnn for NoAnn {} -#[deriving(Copy)] +#[derive(Copy)] pub struct CurrentCommentAndLiteral { cur_cmnt: uint, cur_lit: uint, diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 93fe868f52c..e480532a410 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -282,7 +282,7 @@ fn strip_test_functions(krate: ast::Crate) -> ast::Crate { }) } -#[deriving(PartialEq)] +#[derive(PartialEq)] enum HasTestSignature { Yes, No, diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 6e087778de9..5f416a867e8 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -92,7 +92,7 @@ impl<T: Eq + Hash + Clone + 'static> Interner<T> { } } -#[deriving(Clone, PartialEq, Hash, PartialOrd)] +#[derive(Clone, PartialEq, Hash, PartialOrd)] pub struct RcStr { string: Rc<String>, } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index a1fe63e3f6f..ec6b2cfa5c3 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -32,7 +32,7 @@ use codemap::Span; use ptr::P; use owned_slice::OwnedSlice; -#[deriving(Copy)] +#[derive(Copy)] pub enum FnKind<'a> { /// fn foo() or extern "Abi" fn foo() FkItemFn(Ident, &'a Generics, Unsafety, Abi), |
