From bba701c59d84eac4e20d0796ec06db8d1cdd39cf Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 31 May 2014 10:43:52 -0700 Subject: std: Drop Total from Total{Eq,Ord} This completes the last stage of the renaming of the comparison hierarchy of traits. This change renames TotalEq to Eq and TotalOrd to Ord. In the future the new Eq/Ord will be filled out with their appropriate methods, but for now this change is purely a renaming change. [breaking-change] --- src/libsyntax/abi.rs | 2 +- src/libsyntax/ast.rs | 164 +++++++++++++++--------------- src/libsyntax/codemap.rs | 6 +- src/libsyntax/ext/deriving/generic/mod.rs | 2 +- src/libsyntax/ext/deriving/mod.rs | 4 +- src/libsyntax/owned_slice.rs | 2 +- src/libsyntax/parse/obsolete.rs | 2 +- src/libsyntax/parse/token.rs | 8 +- src/libsyntax/util/interner.rs | 6 +- 9 files changed, 98 insertions(+), 98 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index e61c1c24c2f..cfe85995df6 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -13,7 +13,7 @@ use std::fmt; #[deriving(PartialEq)] pub enum Os { OsWin32, OsMacos, OsLinux, OsAndroid, OsFreebsd, } -#[deriving(PartialEq, TotalEq, Hash, Encodable, Decodable, Clone)] +#[deriving(PartialEq, Eq, Hash, Encodable, Decodable, Clone)] pub enum Abi { // NB: This ordering MUST match the AbiDatas array below. // (This is ensured by the test indices_are_correct().) diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 5eb9308e443..9cbe7e0b5fc 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -39,7 +39,7 @@ pub fn P(value: T) -> P { // table) and a SyntaxContext to track renaming and // macro expansion per Flatt et al., "Macros // That Work Together" -#[deriving(Clone, Hash, PartialOrd, TotalEq, TotalOrd, Show)] +#[deriving(Clone, Hash, PartialOrd, Eq, Ord, Show)] pub struct Ident { pub name: Name, pub ctxt: SyntaxContext @@ -114,7 +114,7 @@ impl, E> Decodable for Ident { /// Function name (not all functions have names) pub type FnIdent = Option; -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Lifetime { pub id: NodeId, pub span: Span, @@ -125,7 +125,7 @@ pub struct Lifetime { // for instance: std::cmp::PartialEq . It's represented // as a sequence of identifiers, along with a bunch // of supporting information. -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Path { pub span: Span, /// A `::foo` path, is relative to the crate root rather than current @@ -137,7 +137,7 @@ pub struct Path { /// A segment of a path: an identifier, an optional lifetime, and a set of /// types. -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct PathSegment { /// The identifier portion of this path segment. pub identifier: Ident, @@ -151,7 +151,7 @@ pub type CrateNum = u32; pub type NodeId = u32; -#[deriving(Clone, TotalEq, TotalOrd, PartialOrd, PartialEq, Encodable, Decodable, Hash, Show)] +#[deriving(Clone, Eq, Ord, PartialOrd, PartialEq, Encodable, Decodable, Hash, Show)] pub struct DefId { pub krate: CrateNum, pub node: NodeId, @@ -171,14 +171,14 @@ pub static 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 Share. -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum TyParamBound { TraitTyParamBound(TraitRef), StaticRegionTyParamBound, OtherRegionTyParamBound(Span) // FIXME -- just here until work for #5723 lands } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct TyParam { pub ident: Ident, pub id: NodeId, @@ -188,7 +188,7 @@ pub struct TyParam { pub span: Span } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Generics { pub lifetimes: Vec, pub ty_params: OwnedSlice, @@ -206,13 +206,13 @@ impl Generics { } } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum MethodProvenance { FromTrait(DefId), FromImpl(DefId), } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Def { DefFn(DefId, FnStyle), DefStaticMethod(/* method */ DefId, MethodProvenance, FnStyle), @@ -249,7 +249,7 @@ pub enum Def { DefMethod(DefId /* method */, Option /* trait */), } -#[deriving(Clone, PartialEq, TotalEq, Hash, Encodable, Decodable, Show)] +#[deriving(Clone, PartialEq, Eq, Hash, Encodable, Decodable, Show)] pub enum DefRegion { DefStaticRegion, DefEarlyBoundRegion(/* index */ uint, /* lifetime decl */ NodeId), @@ -261,7 +261,7 @@ pub enum DefRegion { // used to drive conditional compilation pub type CrateConfig = Vec<@MetaItem> ; -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Crate { pub module: Mod, pub attrs: Vec, @@ -271,7 +271,7 @@ pub struct Crate { pub type MetaItem = Spanned; -#[deriving(Clone, Encodable, Decodable, TotalEq, Hash)] +#[deriving(Clone, Encodable, Decodable, Eq, Hash)] pub enum MetaItem_ { MetaWord(InternedString), MetaList(InternedString, Vec<@MetaItem> ), @@ -303,7 +303,7 @@ impl PartialEq for MetaItem_ { } } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Block { pub view_items: Vec, pub stmts: Vec<@Stmt>, @@ -313,26 +313,26 @@ pub struct Block { pub span: Span, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Pat { pub id: NodeId, pub node: Pat_, pub span: Span, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct FieldPat { pub ident: Ident, pub pat: @Pat, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum BindingMode { BindByRef(Mutability), BindByValue(Mutability), } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Pat_ { PatWild, PatWildMulti, @@ -358,20 +358,20 @@ pub enum Pat_ { PatMac(Mac), } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash, Show)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)] pub enum Mutability { MutMutable, MutImmutable, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum ExprVstore { ExprVstoreUniq, // ~[1,2,3,4] ExprVstoreSlice, // &[1,2,3,4] ExprVstoreMutSlice, // &mut [1,2,3,4] } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum BinOp { BiAdd, BiSub, @@ -393,7 +393,7 @@ pub enum BinOp { BiGt, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum UnOp { UnBox, UnUniq, @@ -404,7 +404,7 @@ pub enum UnOp { pub type Stmt = Spanned; -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Stmt_ { // could be an item or a local (let) binding: StmtDecl(@Decl, NodeId), @@ -421,7 +421,7 @@ pub enum Stmt_ { /// Where a local declaration came from: either a true `let ... = /// ...;`, or one desugared from the pattern of a for loop. -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum LocalSource { LocalLet, LocalFor, @@ -430,7 +430,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 : = ;` -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Local { pub ty: P, pub pat: @Pat, @@ -442,7 +442,7 @@ pub struct Local { pub type Decl = Spanned; -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Decl_ { // a local (let) binding: DeclLocal(@Local), @@ -450,7 +450,7 @@ pub enum Decl_ { DeclItem(@Item), } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Arm { pub attrs: Vec, pub pats: Vec<@Pat>, @@ -458,7 +458,7 @@ pub struct Arm { pub body: @Expr, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Field { pub ident: SpannedIdent, pub expr: @Expr, @@ -467,26 +467,26 @@ pub struct Field { pub type SpannedIdent = Spanned; -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum BlockCheckMode { DefaultBlock, UnsafeBlock(UnsafeSource), } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum UnsafeSource { CompilerGenerated, UserProvided, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Expr { pub id: NodeId, pub node: Expr_, pub span: Span, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Expr_ { ExprVstore(@Expr, ExprVstore), // First expr is the place; second expr is the value. @@ -555,7 +555,7 @@ pub enum Expr_ { // else knows what to do with them, so you'll probably get a syntax // error. // -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] #[doc="For macro invocations; parsing is delegated to the macro"] pub enum TokenTree { // a single token @@ -631,7 +631,7 @@ pub enum TokenTree { // pub type Matcher = Spanned; -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Matcher_ { // match one token MatchTok(::parse::token::Token), @@ -648,12 +648,12 @@ pub type Mac = Spanned; // 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, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Mac_ { MacInvocTT(Path, Vec , SyntaxContext), // new macro-invocation } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum StrStyle { CookedStr, RawStr(uint) @@ -661,7 +661,7 @@ pub enum StrStyle { pub type Lit = Spanned; -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Lit_ { LitStr(InternedString, StrStyle), LitBinary(Rc >), @@ -677,20 +677,20 @@ 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, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct MutTy { pub ty: P, pub mutbl: Mutability, } -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub struct TypeField { pub ident: Ident, pub mt: MutTy, pub span: Span, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct TypeMethod { pub ident: Ident, pub attrs: Vec, @@ -706,13 +706,13 @@ pub struct TypeMethod { // 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, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum TraitMethod { Required(TypeMethod), Provided(@Method), } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum IntTy { TyI, TyI8, @@ -728,7 +728,7 @@ impl fmt::Show for IntTy { } } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum UintTy { TyU, TyU8, @@ -744,7 +744,7 @@ impl fmt::Show for UintTy { } } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum FloatTy { TyF32, TyF64, @@ -758,7 +758,7 @@ impl fmt::Show for FloatTy { } // NB PartialEq method appears below. -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Ty { pub id: NodeId, pub node: Ty_, @@ -766,7 +766,7 @@ pub struct Ty { } // Not represented directly in the AST, referred to by name through a ty_path. -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum PrimTy { TyInt(IntTy), TyUint(UintTy), @@ -776,7 +776,7 @@ pub enum PrimTy { TyChar } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Onceness { Once, Many @@ -791,7 +791,7 @@ impl fmt::Show for Onceness { } } -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub struct ClosureTy { pub lifetimes: Vec, pub fn_style: FnStyle, @@ -804,7 +804,7 @@ pub struct ClosureTy { pub bounds: Option>, } -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub struct BareFnTy { pub fn_style: FnStyle, pub abi: Abi, @@ -812,7 +812,7 @@ pub struct BareFnTy { pub decl: P } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Ty_ { TyNil, TyBot, /* bottom type */ @@ -833,13 +833,13 @@ pub enum Ty_ { TyInfer, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum AsmDialect { AsmAtt, AsmIntel } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct InlineAsm { pub asm: InternedString, pub asm_str_style: StrStyle, @@ -851,7 +851,7 @@ pub struct InlineAsm { pub dialect: AsmDialect } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Arg { pub ty: P, pub pat: @Pat, @@ -878,7 +878,7 @@ impl Arg { } } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct FnDecl { pub inputs: Vec, pub output: P, @@ -886,7 +886,7 @@ pub struct FnDecl { pub variadic: bool } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum FnStyle { UnsafeFn, // declared with "unsafe fn" NormalFn, // declared with "fn" @@ -901,14 +901,14 @@ impl fmt::Show for FnStyle { } } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum RetStyle { NoReturn, // functions with return type _|_ that always // raise an error or exit (i.e. never return to the caller) Return, // everything else } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum ExplicitSelf_ { SelfStatic, // no self SelfValue, // `self` @@ -918,7 +918,7 @@ pub enum ExplicitSelf_ { pub type ExplicitSelf = Spanned; -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Method { pub ident: Ident, pub attrs: Vec, @@ -932,7 +932,7 @@ pub struct Method { pub vis: Visibility, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] 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 @@ -942,31 +942,31 @@ pub struct Mod { pub items: Vec<@Item>, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct ForeignMod { pub abi: Abi, pub view_items: Vec, pub items: Vec<@ForeignItem>, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct VariantArg { pub ty: P, pub id: NodeId, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum VariantKind { TupleVariantKind(Vec), StructVariantKind(@StructDef), } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct EnumDef { pub variants: Vec>, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Variant_ { pub name: Ident, pub attrs: Vec, @@ -978,7 +978,7 @@ pub struct Variant_ { pub type Variant = Spanned; -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct PathListIdent_ { pub name: Ident, pub id: NodeId, @@ -988,7 +988,7 @@ pub type PathListIdent = Spanned; pub type ViewPath = Spanned; -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub enum ViewPath_ { // quux = foo::bar::baz @@ -1005,7 +1005,7 @@ pub enum ViewPath_ { ViewPathList(Path, Vec , NodeId) } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct ViewItem { pub node: ViewItem_, pub attrs: Vec, @@ -1013,7 +1013,7 @@ pub struct ViewItem { pub span: Span, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum ViewItem_ { // ident: name used to refer to this crate in the code // optional (InternedString,StrStyle): if present, this is a location @@ -1029,17 +1029,17 @@ pub type Attribute = Spanned; // 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, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum AttrStyle { AttrOuter, AttrInner, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct AttrId(pub uint); // doc-comments are promoted to attributes that have is_sugared_doc = true -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Attribute_ { pub id: AttrId, pub style: AttrStyle, @@ -1054,13 +1054,13 @@ pub struct Attribute_ { 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, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct TraitRef { pub path: Path, pub ref_id: NodeId, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Visibility { Public, Inherited, @@ -1075,13 +1075,13 @@ impl Visibility { } } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Sized { DynSize, StaticSize, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct StructField_ { pub kind: StructFieldKind, pub id: NodeId, @@ -1091,7 +1091,7 @@ pub struct StructField_ { pub type StructField = Spanned; -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum StructFieldKind { NamedField(Ident, Visibility), UnnamedField(Visibility), // element of a tuple-like struct @@ -1106,7 +1106,7 @@ impl StructFieldKind { } } -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub struct StructDef { pub fields: Vec, /* fields, not including ctor */ /* ID of the constructor. This is only used for tuple- or enum-like @@ -1120,7 +1120,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, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Item { pub ident: Ident, pub attrs: Vec, @@ -1130,7 +1130,7 @@ pub struct Item { pub span: Span, } -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub enum Item_ { ItemStatic(P, Mutability, @Expr), ItemFn(P, FnStyle, Abi, Generics, P), @@ -1148,7 +1148,7 @@ pub enum Item_ { ItemMac(Mac), } -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub struct ForeignItem { pub ident: Ident, pub attrs: Vec, @@ -1158,7 +1158,7 @@ pub struct ForeignItem { pub vis: Visibility, } -#[deriving(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub enum ForeignItem_ { ForeignItemFn(P, Generics), ForeignItemStatic(P, /* is_mutbl */ bool), @@ -1167,7 +1167,7 @@ pub enum ForeignItem_ { // 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(PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(PartialEq, Eq, Encodable, Decodable, Hash)] pub enum InlinedItem { IIItem(@Item), IIMethod(DefId /* impl id */, bool /* is provided */, @Method), diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 59bf9608a09..f31d0d86940 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -33,7 +33,7 @@ pub trait Pos { /// A byte offset. Keep this small (currently 32-bits), as AST contains /// a lot of them. -#[deriving(Clone, PartialEq, TotalEq, Hash, PartialOrd, Show)] +#[deriving(Clone, PartialEq, Eq, Hash, PartialOrd, Show)] pub struct BytePos(pub u32); /// A character offset. Because of multibyte utf8 characters, a byte offset @@ -96,7 +96,7 @@ pub struct Span { pub static DUMMY_SP: Span = Span { lo: BytePos(0), hi: BytePos(0), expn_info: None }; -#[deriving(Clone, PartialEq, TotalEq, Encodable, Decodable, Hash)] +#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Spanned { pub node: T, pub span: Span, @@ -109,7 +109,7 @@ impl PartialEq for Span { fn ne(&self, other: &Span) -> bool { !(*self).eq(other) } } -impl TotalEq for Span {} +impl Eq for Span {} impl, E> Encodable for Span { /* Note #1972 -- spans are encoded but not decoded */ diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index aecfe935d30..7bf4df357f4 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -28,7 +28,7 @@ Supported features (fairly exhaustive): moment. (`TraitDef.additional_bounds`) Unsupported: FIXME #6257: calling methods on reference fields, -e.g. deriving TotalEq/TotalOrd/Clone don't work on `struct A(&int)`, +e.g. deriving Eq/Ord/Clone don't work on `struct A(&int)`, because of how the auto-dereferencing happens. The most important thing for implementers is the `Substructure` and diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs index 1d8081e2ae3..445b21551fd 100644 --- a/src/libsyntax/ext/deriving/mod.rs +++ b/src/libsyntax/ext/deriving/mod.rs @@ -79,9 +79,9 @@ pub fn expand_meta_deriving(cx: &mut ExtCtxt, // NOTE: after a stage0 snap this needs treatment "PartialEq" => expand!(eq::expand_deriving_eq), - "Eq" | "TotalEq" => expand!(totaleq::expand_deriving_totaleq), + "Eq" => expand!(totaleq::expand_deriving_totaleq), "PartialOrd" => expand!(ord::expand_deriving_ord), - "Ord" | "TotalOrd" => expand!(totalord::expand_deriving_totalord), + "Ord" => expand!(totalord::expand_deriving_totalord), "Rand" => expand!(rand::expand_deriving_rand), diff --git a/src/libsyntax/owned_slice.rs b/src/libsyntax/owned_slice.rs index c04c10e0d72..a514c1e9c5d 100644 --- a/src/libsyntax/owned_slice.rs +++ b/src/libsyntax/owned_slice.rs @@ -119,7 +119,7 @@ impl PartialEq for OwnedSlice { } } -impl TotalEq for OwnedSlice {} +impl Eq for OwnedSlice {} impl Container for OwnedSlice { fn len(&self) -> uint { self.len } diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index b7121c6b32c..bba400742b5 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -23,7 +23,7 @@ use parse::parser; use parse::token; /// The specific types of unsupported syntax -#[deriving(PartialEq, TotalEq, Hash)] +#[deriving(PartialEq, Eq, Hash)] pub enum ObsoleteSyntax { ObsoleteOwnedType, ObsoleteOwnedExpr, diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 192adfe7829..34f508e42a1 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -24,7 +24,7 @@ use std::rc::Rc; use std::string::String; #[allow(non_camel_case_types)] -#[deriving(Clone, Encodable, Decodable, PartialEq, TotalEq, Hash, Show)] +#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash, Show)] pub enum BinOp { PLUS, MINUS, @@ -39,7 +39,7 @@ pub enum BinOp { } #[allow(non_camel_case_types)] -#[deriving(Clone, Encodable, Decodable, PartialEq, TotalEq, Hash, Show)] +#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash, Show)] pub enum Token { /* Expression-operator symbols. */ EQ, @@ -102,7 +102,7 @@ pub enum Token { EOF, } -#[deriving(Clone, Encodable, Decodable, PartialEq, TotalEq, Hash)] +#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash)] /// For interpolation during macro expansion. pub enum Nonterminal { NtItem(@ast::Item), @@ -552,7 +552,7 @@ pub fn get_ident_interner() -> Rc { /// 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, TotalEq, TotalOrd)] +#[deriving(Clone, PartialEq, Hash, PartialOrd, Eq, Ord)] pub struct InternedString { string: RcStr, } diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index d2361810a24..66260e50208 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -28,7 +28,7 @@ pub struct Interner { } // when traits can extend traits, we should extend index to get [] -impl Interner { +impl Interner { pub fn new() -> Interner { Interner { map: RefCell::new(HashMap::new()), @@ -95,9 +95,9 @@ pub struct RcStr { string: Rc, } -impl TotalEq for RcStr {} +impl Eq for RcStr {} -impl TotalOrd for RcStr { +impl Ord for RcStr { fn cmp(&self, other: &RcStr) -> Ordering { self.as_slice().cmp(&other.as_slice()) } -- cgit 1.4.1-3-g733a5