diff options
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/abi.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ast.rs | 192 | ||||
| -rw-r--r-- | src/libsyntax/ast_map/mod.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ast_util.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/attr.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/codemap.rs | 18 | ||||
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 11 | ||||
| -rw-r--r-- | src/libsyntax/ext/base.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic/mod.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/mod.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/ext/format.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/mtwt.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 2 |
18 files changed, 156 insertions, 151 deletions
diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index 5f593ac7081..2325b3778c7 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -15,7 +15,7 @@ pub use self::AbiArchitecture::*; use std::fmt; -#[derive(Copy, PartialEq, Eq, Show)] +#[derive(Copy, PartialEq, Eq, Debug)] pub enum Os { OsWindows, OsMacos, @@ -26,7 +26,7 @@ pub enum Os { OsDragonfly, } -#[derive(PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Clone, Copy, Show)] +#[derive(PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Clone, Copy, Debug)] 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)] -#[derive(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Debug)] pub enum Architecture { X86, X86_64, diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 4dada5bc81e..11068880b0e 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -208,14 +208,14 @@ impl Decodable for Ident { pub type FnIdent = Option<Ident>; #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, - Show, Copy)] + Debug, Copy)] pub struct Lifetime { pub id: NodeId, pub span: Span, pub name: Name } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct LifetimeDef { pub lifetime: Lifetime, pub bounds: Vec<Lifetime> @@ -224,7 +224,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. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Path { pub span: Span, /// A `::foo` path, is relative to the crate root rather than current @@ -236,7 +236,7 @@ pub struct Path { /// A segment of a path: an identifier, an optional lifetime, and a set of /// types. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct PathSegment { /// The identifier portion of this path segment. pub identifier: Ident, @@ -249,7 +249,7 @@ pub struct PathSegment { pub parameters: PathParameters, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum PathParameters { AngleBracketedParameters(AngleBracketedParameterData), ParenthesizedParameters(ParenthesizedParameterData), @@ -327,7 +327,7 @@ impl PathParameters { } /// A path like `Foo<'a, T>` -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct AngleBracketedParameterData { /// The lifetime parameters for this path segment. pub lifetimes: Vec<Lifetime>, @@ -345,7 +345,7 @@ impl AngleBracketedParameterData { } /// A path like `Foo(A,B) -> C` -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct ParenthesizedParameterData { /// Overall span pub span: Span, @@ -362,7 +362,7 @@ pub type CrateNum = u32; pub type NodeId = u32; #[derive(Clone, Eq, Ord, PartialOrd, PartialEq, RustcEncodable, - RustcDecodable, Hash, Show, Copy)] + RustcDecodable, Hash, Debug, Copy)] pub struct DefId { pub krate: CrateNum, pub node: NodeId, @@ -382,7 +382,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. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum TyParamBound { TraitTyParamBound(PolyTraitRef, TraitBoundModifier), RegionTyParamBound(Lifetime) @@ -390,7 +390,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. -#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum TraitBoundModifier { None, Maybe, @@ -398,7 +398,7 @@ pub enum TraitBoundModifier { pub type TyParamBounds = OwnedSlice<TyParamBound>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct TyParam { pub ident: Ident, pub id: NodeId, @@ -409,7 +409,7 @@ pub struct TyParam { /// Represents lifetimes and type parameters attached to a declaration /// of a function, enum, trait, etc. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Generics { pub lifetimes: Vec<LifetimeDef>, pub ty_params: OwnedSlice<TyParam>, @@ -428,34 +428,34 @@ impl Generics { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct WhereClause { pub id: NodeId, pub predicates: Vec<WherePredicate>, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum WherePredicate { BoundPredicate(WhereBoundPredicate), RegionPredicate(WhereRegionPredicate), EqPredicate(WhereEqPredicate) } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct WhereBoundPredicate { pub span: Span, pub bounded_ty: P<Ty>, pub bounds: OwnedSlice<TyParamBound>, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct WhereRegionPredicate { pub span: Span, pub lifetime: Lifetime, pub bounds: Vec<Lifetime>, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct WhereEqPredicate { pub id: NodeId, pub span: Span, @@ -467,7 +467,7 @@ pub struct WhereEqPredicate { /// used to drive conditional compilation pub type CrateConfig = Vec<P<MetaItem>> ; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Crate { pub module: Mod, pub attrs: Vec<Attribute>, @@ -478,7 +478,7 @@ pub struct Crate { pub type MetaItem = Spanned<MetaItem_>; -#[derive(Clone, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum MetaItem_ { MetaWord(InternedString), MetaList(InternedString, Vec<P<MetaItem>>), @@ -510,7 +510,7 @@ impl PartialEq for MetaItem_ { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Block { pub stmts: Vec<P<Stmt>>, pub expr: Option<P<Expr>>, @@ -519,27 +519,27 @@ pub struct Block { pub span: Span, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Pat { pub id: NodeId, pub node: Pat_, pub span: Span, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct FieldPat { pub ident: Ident, pub pat: P<Pat>, pub is_shorthand: bool, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum BindingMode { BindByRef(Mutability), BindByValue(Mutability), } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum PatWildKind { /// Represents the wildcard pattern `_` PatWildSingle, @@ -548,7 +548,7 @@ pub enum PatWildKind { PatWildMulti, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Pat_ { /// Represents a wildcard pattern (either `_` or `..`) PatWild(PatWildKind), @@ -577,13 +577,13 @@ pub enum Pat_ { PatMac(Mac), } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum Mutability { MutMutable, MutImmutable, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum BinOp_ { BiAdd, BiSub, @@ -607,7 +607,7 @@ pub enum BinOp_ { pub type BinOp = Spanned<BinOp_>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum UnOp { UnUniq, UnDeref, @@ -617,7 +617,7 @@ pub enum UnOp { pub type Stmt = Spanned<Stmt_>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Stmt_ { /// Could be an item or a local (let) binding: StmtDecl(P<Decl>, NodeId), @@ -631,7 +631,7 @@ pub enum Stmt_ { StmtMac(P<Mac>, MacStmtStyle), } -#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum MacStmtStyle { /// The macro statement had a trailing semicolon, e.g. `foo! { ... };` /// `foo!(...);`, `foo![...];` @@ -646,7 +646,7 @@ pub enum MacStmtStyle { /// Where a local declaration came from: either a true `let ... = /// ...;`, or one desugared from the pattern of a for loop. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum LocalSource { LocalLet, LocalFor, @@ -655,7 +655,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>;` -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Local { pub pat: P<Pat>, pub ty: Option<P<Ty>>, @@ -667,7 +667,7 @@ pub struct Local { pub type Decl = Spanned<Decl_>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Decl_ { /// A local (let) binding: DeclLocal(P<Local>), @@ -676,7 +676,7 @@ pub enum Decl_ { } /// represents one arm of a 'match' -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Arm { pub attrs: Vec<Attribute>, pub pats: Vec<P<Pat>>, @@ -684,7 +684,7 @@ pub struct Arm { pub body: P<Expr>, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Field { pub ident: SpannedIdent, pub expr: P<Expr>, @@ -693,26 +693,26 @@ pub struct Field { pub type SpannedIdent = Spanned<Ident>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum BlockCheckMode { DefaultBlock, UnsafeBlock(UnsafeSource), } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum UnsafeSource { CompilerGenerated, UserProvided, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Expr { pub id: NodeId, pub node: Expr_, pub span: Span, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Expr_ { /// First expr is the place; second expr is the value. ExprBox(Option<P<Expr>>, P<Expr>), @@ -776,28 +776,28 @@ pub enum Expr_ { /// <Vec<T> as SomeTrait>::SomeAssociatedItem /// ^~~~~ ^~~~~~~~~ ^~~~~~~~~~~~~~~~~~ /// self_type trait_name item_path -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct QPath { pub self_type: P<Ty>, pub trait_ref: P<TraitRef>, pub item_path: PathSegment, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum MatchSource { Normal, IfLetDesugar { contains_else_clause: bool }, WhileLetDesugar, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum CaptureClause { CaptureByValue, CaptureByRef, } /// A delimited sequence of token trees -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Delimited { /// The type of delimiter pub delim: token::DelimToken, @@ -832,7 +832,7 @@ impl Delimited { } /// A sequence of token treesee -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct SequenceRepetition { /// The sequence of token trees pub tts: Vec<TokenTree>, @@ -846,7 +846,7 @@ pub struct SequenceRepetition { /// A Kleene-style [repetition operator](http://en.wikipedia.org/wiki/Kleene_star) /// for token sequences. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum KleeneOp { ZeroOrMore, OneOrMore, @@ -864,7 +864,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. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] #[doc="For macro invocations; parsing is delegated to the macro"] pub enum TokenTree { /// A single token @@ -955,14 +955,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. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] 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 } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum StrStyle { CookedStr, RawStr(usize) @@ -970,7 +970,7 @@ pub enum StrStyle { pub type Lit = Spanned<Lit_>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum Sign { Minus, Plus @@ -986,7 +986,7 @@ impl Sign { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum LitIntType { SignedIntLit(IntTy, Sign), UnsignedIntLit(UintTy), @@ -1003,7 +1003,7 @@ impl LitIntType { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Lit_ { LitStr(InternedString, StrStyle), LitBinary(Rc<Vec<u8>>), @@ -1017,13 +1017,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. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct MutTy { pub ty: P<Ty>, pub mutbl: Mutability, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct TypeField { pub ident: Ident, pub mt: MutTy, @@ -1032,7 +1032,7 @@ pub struct TypeField { /// Represents a required method in a trait declaration, /// one without a default implementation -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct TypeMethod { pub ident: Ident, pub attrs: Vec<Attribute>, @@ -1050,26 +1050,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). -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum TraitItem { RequiredMethod(TypeMethod), ProvidedMethod(P<Method>), TypeTraitItem(P<AssociatedType>), } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum ImplItem { MethodImplItem(P<Method>), TypeImplItem(P<Typedef>), } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct AssociatedType { pub attrs: Vec<Attribute>, pub ty_param: TyParam, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Typedef { pub id: NodeId, pub span: Span, @@ -1196,7 +1196,7 @@ impl FloatTy { } // Bind a type to an associated type: `A=Foo`. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct TypeBinding { pub id: NodeId, pub ident: Ident, @@ -1206,7 +1206,7 @@ pub struct TypeBinding { // NB PartialEq method appears below. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Ty { pub id: NodeId, pub node: Ty_, @@ -1214,7 +1214,7 @@ pub struct Ty { } /// Not represented directly in the AST, referred to by name through a ty_path. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum PrimTy { TyInt(IntTy), TyUint(UintTy), @@ -1224,7 +1224,7 @@ pub enum PrimTy { TyChar } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct BareFnTy { pub unsafety: Unsafety, pub abi: Abi, @@ -1232,7 +1232,7 @@ pub struct BareFnTy { pub decl: P<FnDecl> } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] /// The different kinds of types recognized by the compiler pub enum Ty_ { TyVec(P<Ty>), @@ -1265,13 +1265,13 @@ pub enum Ty_ { TyInfer, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum AsmDialect { AsmAtt, AsmIntel } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct InlineAsm { pub asm: InternedString, pub asm_str_style: StrStyle, @@ -1285,7 +1285,7 @@ pub struct InlineAsm { } /// represents an argument in a function header -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Arg { pub ty: P<Ty>, pub pat: P<Pat>, @@ -1313,14 +1313,14 @@ impl Arg { } /// represents the header (not the body) of a function declaration -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct FnDecl { pub inputs: Vec<Arg>, pub output: FunctionRetTy, pub variadic: bool } -#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Unsafety { Unsafe, Normal, @@ -1353,7 +1353,7 @@ impl fmt::Debug for ImplPolarity { } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum FunctionRetTy { /// Functions with return type ! that always /// raise an error or exit (i.e. never return to the caller) @@ -1377,7 +1377,7 @@ impl FunctionRetTy { } /// Represents the kind of 'self' associated with a method -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum ExplicitSelf_ { /// No self SelfStatic, @@ -1391,7 +1391,7 @@ pub enum ExplicitSelf_ { pub type ExplicitSelf = Spanned<ExplicitSelf_>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Method { pub attrs: Vec<Attribute>, pub id: NodeId, @@ -1399,7 +1399,7 @@ pub struct Method { pub node: Method_, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Method_ { /// Represents a method declaration MethDecl(Ident, @@ -1414,7 +1414,7 @@ pub enum Method_ { MethMac(Mac), } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] 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 @@ -1423,30 +1423,30 @@ pub struct Mod { pub items: Vec<P<Item>>, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct ForeignMod { pub abi: Abi, pub items: Vec<P<ForeignItem>>, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct VariantArg { pub ty: P<Ty>, pub id: NodeId, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum VariantKind { TupleVariantKind(Vec<VariantArg>), StructVariantKind(P<StructDef>), } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct EnumDef { pub variants: Vec<P<Variant>>, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Variant_ { pub name: Ident, pub attrs: Vec<Attribute>, @@ -1458,7 +1458,7 @@ pub struct Variant_ { pub type Variant = Spanned<Variant_>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum PathListItem_ { PathListIdent { name: Ident, id: NodeId }, PathListMod { id: NodeId } @@ -1476,7 +1476,7 @@ pub type PathListItem = Spanned<PathListItem_>; pub type ViewPath = Spanned<ViewPath_>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum ViewPath_ { /// `foo::bar::baz as quux` @@ -1499,17 +1499,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. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum AttrStyle { AttrOuter, AttrInner, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub struct AttrId(pub usize); /// Doc-comments are promoted to attributes that have is_sugared_doc = true -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Attribute_ { pub id: AttrId, pub style: AttrStyle, @@ -1522,13 +1522,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). -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct TraitRef { pub path: Path, pub ref_id: NodeId, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct PolyTraitRef { /// The `'a` in `<'a> Foo<&'a T>` pub bound_lifetimes: Vec<LifetimeDef>, @@ -1537,7 +1537,7 @@ pub struct PolyTraitRef { pub trait_ref: TraitRef, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum Visibility { Public, Inherited, @@ -1552,7 +1552,7 @@ impl Visibility { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct StructField_ { pub kind: StructFieldKind, pub id: NodeId, @@ -1571,7 +1571,7 @@ impl StructField_ { pub type StructField = Spanned<StructField_>; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum StructFieldKind { NamedField(Ident, Visibility), /// Element of a tuple-like struct @@ -1587,7 +1587,7 @@ impl StructFieldKind { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct StructDef { /// Fields, not including ctor pub fields: Vec<StructField>, @@ -1600,7 +1600,7 @@ pub struct StructDef { FIXME (#3300): Should allow items to be anonymous. Right now we just use dummy names for anon items. */ -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct Item { pub ident: Ident, pub attrs: Vec<Attribute>, @@ -1610,7 +1610,7 @@ pub struct Item { pub span: Span, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Item_ { // Optional location (containing arbitrary characters) from which // to fetch the crate sources. @@ -1661,7 +1661,7 @@ impl Item_ { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct ForeignItem { pub ident: Ident, pub attrs: Vec<Attribute>, @@ -1671,7 +1671,7 @@ pub struct ForeignItem { pub vis: Visibility, } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum ForeignItem_ { ForeignItemFn(P<FnDecl>, Generics), ForeignItemStatic(P<Ty>, /* is_mutbl */ bool), @@ -1686,7 +1686,7 @@ impl ForeignItem_ { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum ClosureKind { FnClosureKind, FnMutClosureKind, @@ -1696,7 +1696,7 @@ pub enum ClosureKind { /// 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. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum InlinedItem { IIItem(P<Item>), IITraitItem(DefId /* impl id */, TraitItem), @@ -1707,7 +1707,7 @@ pub enum InlinedItem { /// A macro definition, in this crate or imported from another. /// /// Not parsed directly, but created on macro import or `macro_rules!` expansion. -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct MacroDef { pub ident: Ident, pub attrs: Vec<Attribute>, diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index 002e003afcb..8546e03cc87 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; -#[derive(Clone, Copy, PartialEq, Show)] +#[derive(Clone, Copy, PartialEq, Debug)] pub enum PathElem { PathMod(Name), PathName(Name) @@ -91,7 +91,7 @@ pub fn path_to_string<PI: Iterator<Item=PathElem>>(path: PI) -> String { }) } -#[derive(Copy, Show)] +#[derive(Copy, Debug)] pub enum Node<'ast> { NodeItem(&'ast Item), NodeForeignItem(&'ast ForeignItem), @@ -113,7 +113,7 @@ pub enum Node<'ast> { /// Represents an entry and its parent Node ID /// The odd layout is to bring down the total size. -#[derive(Copy, Show)] +#[derive(Copy, Debug)] enum MapEntry<'ast> { /// Placeholder for holes in the map. NotPresent, @@ -144,7 +144,7 @@ impl<'ast> Clone for MapEntry<'ast> { } } -#[derive(Show)] +#[derive(Debug)] struct InlinedParent { path: Vec<PathElem>, ii: InlinedItem diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 07d3290d410..7f1264ac9a1 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -352,7 +352,7 @@ pub fn empty_generics() -> Generics { // ______________________________________________________________________ // Enumerating the IDs which appear in an AST -#[derive(RustcEncodable, RustcDecodable, Show, Copy)] +#[derive(RustcEncodable, RustcDecodable, Debug, Copy)] pub struct IdRange { pub min: NodeId, pub max: NodeId, diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 061600d9420..4427a7aaf02 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -346,7 +346,7 @@ pub fn cfg_matches(diagnostic: &SpanHandler, cfgs: &[P<MetaItem>], cfg: &ast::Me } /// Represents the #[deprecated] and friends attributes. -#[derive(RustcEncodable,RustcDecodable,Clone,Show)] +#[derive(RustcEncodable,RustcDecodable,Clone,Debug)] pub struct Stability { pub level: StabilityLevel, pub feature: InternedString, @@ -358,7 +358,7 @@ pub struct Stability { } /// The available stability levels. -#[derive(RustcEncodable,RustcDecodable,PartialEq,PartialOrd,Clone,Show,Copy)] +#[derive(RustcEncodable,RustcDecodable,PartialEq,PartialOrd,Clone,Debug,Copy)] pub enum StabilityLevel { Unstable, Stable, @@ -570,7 +570,7 @@ fn int_type_of_word(s: &str) -> Option<IntType> { } } -#[derive(PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] +#[derive(PartialEq, Debug, RustcEncodable, RustcDecodable, Copy)] pub enum ReprAttr { ReprAny, ReprInt(Span, IntType), @@ -589,7 +589,7 @@ impl ReprAttr { } } -#[derive(Eq, Hash, PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] +#[derive(Eq, Hash, PartialEq, Debug, 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 e0d4f69a34c..8adb9b24222 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. -#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Debug)] 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. -#[derive(Copy, PartialEq, Hash, PartialOrd, Show)] +#[derive(Copy, PartialEq, Hash, PartialOrd, Debug)] pub struct CharPos(pub usize); // 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. -#[derive(Clone, Copy, Show, Hash)] +#[derive(Clone, Copy, Debug, Hash)] pub struct Span { pub lo: BytePos, pub hi: BytePos, @@ -110,7 +110,7 @@ pub const COMMAND_LINE_SP: Span = Span { lo: BytePos(0), hi: BytePos(0), expn_id: COMMAND_LINE_EXPN }; -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub struct Spanned<T> { pub node: T, pub span: Span, @@ -193,7 +193,7 @@ pub struct FileMapAndLine { pub fm: Rc<FileMap>, pub line: usize } pub struct FileMapAndBytePos { pub fm: Rc<FileMap>, pub pos: BytePos } /// The syntax with which a macro was invoked. -#[derive(Clone, Copy, Hash, Show)] +#[derive(Clone, Copy, Hash, Debug)] pub enum MacroFormat { /// e.g. #[derive(...)] <item> MacroAttribute, @@ -201,7 +201,7 @@ pub enum MacroFormat { MacroBang } -#[derive(Clone, Hash, Show)] +#[derive(Clone, Hash, Debug)] pub struct NameAndSpan { /// The name of the macro that was invoked to create the thing /// with this Span. @@ -215,7 +215,7 @@ pub struct NameAndSpan { } /// Extra information for tracking macro expansion of spans -#[derive(Hash, Show)] +#[derive(Hash, Debug)] pub struct ExpnInfo { /// The location of the actual macro invocation, e.g. `let x = /// foo!();` @@ -236,7 +236,7 @@ pub struct ExpnInfo { pub callee: NameAndSpan } -#[derive(PartialEq, Eq, Clone, Show, Hash, RustcEncodable, RustcDecodable, Copy)] +#[derive(PartialEq, Eq, Clone, Debug, Hash, RustcEncodable, RustcDecodable, Copy)] pub struct ExpnId(u32); pub const NO_EXPANSION: ExpnId = ExpnId(-1); @@ -431,7 +431,7 @@ impl CodeMap { let lo = self.lookup_char_pos(sp.lo); let hi = self.lookup_char_pos(sp.hi); let mut lines = Vec::new(); - for i in range(lo.line - 1us, hi.line as usize) { + for i in lo.line - 1us..hi.line as usize { lines.push(i); }; FileLines {file: lo.file, lines: lines} diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index f3e66897316..821ac8e2f89 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -20,7 +20,6 @@ use diagnostics; use std::cell::{RefCell, Cell}; use std::fmt; use std::old_io; -use std::iter::range; use std::string::String; use term::WriterWrapper; use term; @@ -235,7 +234,7 @@ pub fn mk_handler(can_emit_warnings: bool, e: Box<Emitter + Send>) -> Handler { } } -#[derive(Copy, PartialEq, Clone, Show)] +#[derive(Copy, PartialEq, Clone, Debug)] pub enum Level { Bug, Fatal, @@ -490,11 +489,11 @@ fn highlight_lines(err: &mut EmitterWriter, // Skip is the number of characters we need to skip because they are // part of the 'filename:line ' part of the previous line. let skip = fm.name.len() + digits + 3us; - for _ in range(0, skip) { + for _ in 0..skip { s.push(' '); } if let Some(orig) = fm.get_line(lines.lines[0]) { - for pos in range(0us, left - skip) { + for pos in 0us..left - skip { let cur_char = orig.as_bytes()[pos] as char; // Whenever a tab occurs on the previous line, we insert one on // the error-point-squiggly-line as well (instead of a space). @@ -513,7 +512,7 @@ fn highlight_lines(err: &mut EmitterWriter, if hi.col != lo.col { // the ^ already takes up one space let num_squigglies = hi.col.to_usize() - lo.col.to_usize() - 1us; - for _ in range(0, num_squigglies) { + for _ in 0..num_squigglies { s.push('~'); } } @@ -563,7 +562,7 @@ fn custom_highlight_lines(w: &mut EmitterWriter, // Span seems to use half-opened interval, so subtract 1 let skip = last_line_start.len() + hi.col.to_usize() - 1; let mut s = String::new(); - for _ in range(0, skip) { + for _ in 0..skip { s.push(' '); } s.push('^'); diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index dd89153d497..a184cc5c2b2 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -73,7 +73,7 @@ impl<F> ItemModifier for F } } -#[derive(Show,Clone)] +#[derive(Debug,Clone)] pub enum Annotatable { Item(P<ast::Item>), TraitItem(ast::TraitItem), diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index 56ff455a02b..1b84d93738d 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -770,7 +770,7 @@ impl<'a> MethodDef<'a> { let mut raw_fields = Vec::new(); // ~[[fields of self], // [fields of next Self arg], [etc]] let mut patterns = Vec::new(); - for i in range(0us, self_args.len()) { + for i in 0us..self_args.len() { let struct_path= cx.path(DUMMY_SP, vec!( type_ident )); let (pat, ident_expr) = trait_.create_struct_pattern(cx, @@ -1154,7 +1154,7 @@ impl<'a> MethodDef<'a> { // to an uninhabited type (e.g. a zero-variant enum or a // type holding such an enum), but do not feature-gate // zero-variant enums themselves, then attempting to - // derive Show on such a type could here generate code + // derive Debug on such a type could here generate code // that needs the feature gate enabled.) return cx.expr_unreachable(sp); diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs index ddec517a78e..d3d7fee3a18 100644 --- a/src/libsyntax/ext/deriving/mod.rs +++ b/src/libsyntax/ext/deriving/mod.rs @@ -107,8 +107,14 @@ pub fn expand_meta_derive(cx: &mut ExtCtxt, "Rand" => expand!(rand::expand_deriving_rand), - // NOTE(stage0): remove "Show" - "Show" => expand!(show::expand_deriving_show), + "Show" => { + cx.span_warn(titem.span, + "derive(Show) is deprecated \ + in favor of derive(Debug)"); + + expand!(show::expand_deriving_show) + }, + "Debug" => expand!(show::expand_deriving_show), "Default" => expand!(default::expand_deriving_default), diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index 8ea9d6168ef..2a0a352f128 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -661,7 +661,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span, name_ordering: Vec<String>, names: HashMap<String, P<ast::Expr>>) -> P<ast::Expr> { - let arg_types: Vec<_> = range(0, args.len()).map(|_| None).collect(); + let arg_types: Vec<_> = (0..args.len()).map(|_| None).collect(); let mut cx = Context { ecx: ecx, args: args, diff --git a/src/libsyntax/ext/mtwt.rs b/src/libsyntax/ext/mtwt.rs index 7adc443759f..b6563d77b88 100644 --- a/src/libsyntax/ext/mtwt.rs +++ b/src/libsyntax/ext/mtwt.rs @@ -38,7 +38,7 @@ pub struct SCTable { rename_memo: RefCell<HashMap<(SyntaxContext,Ident,Name),SyntaxContext>>, } -#[derive(PartialEq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum SyntaxContext_ { EmptyCtxt, Mark (Mrk,SyntaxContext), @@ -309,7 +309,7 @@ mod tests { // because of the SCTable, I now need a tidy way of // creating syntax objects. Sigh. - #[derive(Clone, PartialEq, Show)] + #[derive(Clone, PartialEq, Debug)] enum TestSC { M(Mrk), R(Ident,Name) diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 7e345a2d078..0f617302c92 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -665,7 +665,7 @@ fn mk_tt(cx: &ExtCtxt, tt: &ast::TokenTree) -> Vec<P<ast::Stmt>> { } ref tt @ ast::TtToken(_, MatchNt(..)) => { let mut seq = vec![]; - for i in range(0, tt.len()) { + for i in 0..tt.len() { seq.push(tt.get_tt(i)); } mk_tts(cx, &seq[]) diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 9d5be3fff61..e3211c7c337 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -166,7 +166,7 @@ pub fn count_names(ms: &[TokenTree]) -> usize { pub fn initial_matcher_pos(ms: Rc<Vec<TokenTree>>, sep: Option<Token>, lo: BytePos) -> Box<MatcherPos> { let match_idx_hi = count_names(&ms[]); - let matches: Vec<_> = range(0, match_idx_hi).map(|_| Vec::new()).collect(); + let matches: Vec<_> = (0..match_idx_hi).map(|_| Vec::new()).collect(); box MatcherPos { stack: vec![], top_elts: TtSeq(ms), @@ -339,7 +339,7 @@ pub fn parse(sess: &ParseSess, // most of the time. // Only touch the binders we have actually bound - for idx in range(ei.match_lo, ei.match_hi) { + for idx in ei.match_lo..ei.match_hi { let sub = (ei.matches[idx]).clone(); (&mut new_pos.matches[idx]) .push(Rc::new(MatchedSeq(sub, mk_sp(ei.sp_lo, @@ -385,14 +385,14 @@ pub fn parse(sess: &ParseSess, new_ei.match_cur += seq.num_captures; new_ei.idx += 1us; //we specifically matched zero repeats. - for idx in range(ei.match_cur, ei.match_cur + seq.num_captures) { + for idx in ei.match_cur..ei.match_cur + seq.num_captures { (&mut new_ei.matches[idx]).push(Rc::new(MatchedSeq(vec![], sp))); } cur_eis.push(new_ei); } - let matches: Vec<_> = range(0, ei.matches.len()) + let matches: Vec<_> = (0..ei.matches.len()) .map(|_| Vec::new()).collect(); let ei_t = ei; cur_eis.push(box MatcherPos { @@ -495,7 +495,7 @@ pub fn parse(sess: &ParseSess, } cur_eis.push(ei); - for _ in range(0, rust_parser.tokens_consumed) { + for _ in 0..rust_parser.tokens_consumed { let _ = rdr.next_token(); } } diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 99be1b11b11..493a97c24cf 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -52,7 +52,7 @@ pub trait Reader { } } -#[derive(Clone, PartialEq, Eq, Show)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct TokenAndSpan { pub tok: token::Token, pub sp: Span, @@ -732,7 +732,7 @@ impl<'a> StringReader<'a> { let start_bpos = self.last_pos; let mut accum_int = 0; - for _ in range(0, n_digits) { + for _ in 0..n_digits { if self.is_eof() { let last_bpos = self.last_pos; self.fatal_span_(start_bpos, last_bpos, "unterminated numeric character escape"); @@ -1217,7 +1217,7 @@ impl<'a> StringReader<'a> { } //if self.curr_is('"') { //content_end_bpos = self.last_pos; - //for _ in range(0, hash_count) { + //for _ in 0..hash_count { //self.bump(); //if !self.curr_is('#') { //continue 'outer; @@ -1225,7 +1225,7 @@ impl<'a> StringReader<'a> { match c { '"' => { content_end_bpos = self.last_pos; - for _ in range(0, hash_count) { + for _ in 0..hash_count { self.bump(); if !self.curr_is('#') { continue 'outer; @@ -1402,7 +1402,7 @@ impl<'a> StringReader<'a> { }, Some('"') => { content_end_bpos = self.last_pos; - for _ in range(0, hash_count) { + for _ in 0..hash_count { self.bump(); if !self.curr_is('#') { continue 'outer; diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 0be7b605e57..1c146968fd5 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -472,7 +472,7 @@ pub fn str_lit(lit: &str) -> String { } else { // otherwise, a normal escape let (c, n) = char_lit(&lit[i..]); - for _ in range(0, n - 1) { // we don't need to move past the first \ + for _ in 0..n - 1 { // we don't need to move past the first \ chars.next(); } res.push(c); @@ -635,7 +635,7 @@ pub fn binary_lit(lit: &str) -> Rc<Vec<u8>> { // otherwise, a normal escape let (c, n) = byte_lit(&lit[i..]); // we don't need to move past the first \ - for _ in range(0, n - 1) { + for _ in 0..n - 1 { chars.next(); } res.push(c); diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index ac694afac6b..1ef33a2401e 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -29,7 +29,7 @@ use std::path::BytesContainer; use std::rc::Rc; #[allow(non_camel_case_types)] -#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)] pub enum BinOpToken { Plus, Minus, @@ -44,7 +44,7 @@ pub enum BinOpToken { } /// A delimiter token -#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)] pub enum DelimToken { /// A round parenthesis: `(` or `)` Paren, @@ -54,14 +54,14 @@ pub enum DelimToken { Brace, } -#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)] pub enum IdentStyle { /// `::` follows the identifier with no whitespace in-between. ModName, Plain, } -#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)] pub enum SpecialMacroVar { /// `$crate` will be filled in with the name of the crate a macro was /// imported from, if any. @@ -76,7 +76,7 @@ impl SpecialMacroVar { } } -#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug, Copy)] pub enum Lit { Byte(ast::Name), Char(ast::Name), @@ -102,7 +102,7 @@ impl Lit { } #[allow(non_camel_case_types)] -#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Debug)] pub enum Token { /* Expression-operator symbols. */ Eq, diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index f9a202523b5..5367ccc1357 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2457,7 +2457,7 @@ impl<'a> State<'a> { try!(word(&mut self.s, "<")); let mut ints = Vec::new(); - for i in range(0us, total) { + for i in 0us..total { ints.push(i); } |
