From 9966eaaba4d08dd9eb3cbbb1a92555f23d5f1a10 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Wed, 20 Mar 2013 11:40:02 -0400 Subject: [PATCH] rustc: replace uses of old deriving attribute with new one --- src/librustc/back/link.rs | 2 +- src/librustc/driver/driver.rs | 2 +- src/librustc/driver/session.rs | 6 ++-- src/librustc/lib/llvm.rs | 2 +- src/librustc/metadata/decoder.rs | 2 +- src/librustc/middle/borrowck/check_loans.rs | 4 +-- src/librustc/middle/borrowck/mod.rs | 8 ++--- src/librustc/middle/check_match.rs | 2 +- src/librustc/middle/const_eval.rs | 2 +- src/librustc/middle/lint.rs | 4 +-- src/librustc/middle/mem_categorization.rs | 14 ++++---- src/librustc/middle/region.rs | 2 +- src/librustc/middle/resolve.rs | 14 ++++---- src/librustc/middle/trans/_match.rs | 2 +- src/librustc/middle/trans/common.rs | 8 ++--- src/librustc/middle/trans/datum.rs | 4 +-- src/librustc/middle/ty.rs | 36 +++++++++---------- src/librustc/middle/typeck/check/method.rs | 4 +-- .../middle/typeck/infer/region_inference.rs | 4 +-- src/librustc/rustc.rc | 2 +- 20 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 4c8f27167816e..5f9a3e606f201 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -38,7 +38,7 @@ use syntax::ast_map::{path, path_mod, path_name}; use syntax::attr; use syntax::print::pprust; -#[deriving_eq] +#[deriving(Eq)] pub enum output_type { output_type_none, output_type_bitcode, diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs index b983fa316d304..a4fdd7f1b5249 100644 --- a/src/librustc/driver/driver.rs +++ b/src/librustc/driver/driver.rs @@ -161,7 +161,7 @@ pub fn parse_input(sess: Session, +cfg: ast::crate_cfg, input: input) } } -#[deriving_eq] +#[deriving(Eq)] pub enum compile_upto { cu_parse, cu_expand, diff --git a/src/librustc/driver/session.rs b/src/librustc/driver/session.rs index 75400c5e3244c..caf4689688b10 100644 --- a/src/librustc/driver/session.rs +++ b/src/librustc/driver/session.rs @@ -27,10 +27,10 @@ use syntax::parse::ParseSess; use syntax::{ast, codemap}; use syntax; -#[deriving_eq] +#[deriving(Eq)] pub enum os { os_win32, os_macos, os_linux, os_android, os_freebsd, } -#[deriving_eq] +#[deriving(Eq)] pub enum arch { arch_x86, arch_x86_64, arch_arm, arch_mips, } pub enum crate_type { bin_crate, lib_crate, unknown_crate, } @@ -104,7 +104,7 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] { ] } -#[deriving_eq] +#[deriving(Eq)] pub enum OptLevel { No, // -O0 Less, // -O1 diff --git a/src/librustc/lib/llvm.rs b/src/librustc/lib/llvm.rs index e5234dff91d13..5cdfe6a49f723 100644 --- a/src/librustc/lib/llvm.rs +++ b/src/librustc/lib/llvm.rs @@ -127,7 +127,7 @@ pub enum RealPredicate { // enum for the LLVM TypeKind type - must stay in sync with the def of // LLVMTypeKind in llvm/include/llvm-c/Core.h -#[deriving_eq] +#[deriving(Eq)] pub enum TypeKind { Void = 0, Half = 1, diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index 292a11062613d..655bfc4446ec8 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -93,7 +93,7 @@ fn lookup_item(item_id: int, data: @~[u8]) -> ebml::Doc { } } -#[deriving_eq] +#[deriving(Eq)] enum Family { Const, // c Fn, // f diff --git a/src/librustc/middle/borrowck/check_loans.rs b/src/librustc/middle/borrowck/check_loans.rs index 17bdf318e0708..6dfcf6ddf9168 100644 --- a/src/librustc/middle/borrowck/check_loans.rs +++ b/src/librustc/middle/borrowck/check_loans.rs @@ -51,7 +51,7 @@ struct CheckLoanCtxt { } // if we are enforcing purity, why are we doing so? -#[deriving_eq] +#[deriving(Eq)] enum purity_cause { // enforcing purity because fn was declared pure: pc_pure_fn, @@ -80,7 +80,7 @@ pub fn check_loans(bccx: @BorrowckCtxt, visit::visit_crate(*crate, clcx, vt); } -#[deriving_eq] +#[deriving(Eq)] enum assignment_type { at_straight_up, at_swap diff --git a/src/librustc/middle/borrowck/mod.rs b/src/librustc/middle/borrowck/mod.rs index 3e63707162417..daa365aade125 100644 --- a/src/librustc/middle/borrowck/mod.rs +++ b/src/librustc/middle/borrowck/mod.rs @@ -340,7 +340,7 @@ pub type root_map = HashMap; // if you have an expression `x.f` and x has type ~@T, we could add an // entry {id:x, derefs:0} to refer to `x` itself, `{id:x, derefs:1}` // to refer to the deref of the unique pointer, and so on. -#[deriving_eq] +#[deriving(Eq)] pub struct root_map_key { id: ast::node_id, derefs: uint @@ -355,7 +355,7 @@ pub type mutbl_map = HashMap; pub type write_guard_map = HashMap; // Errors that can occur -#[deriving_eq] +#[deriving(Eq)] pub enum bckerr_code { err_mut_uniq, err_mut_variant, @@ -367,7 +367,7 @@ pub enum bckerr_code { // Combination of an error code and the categorization of the expression // that caused it -#[deriving_eq] +#[deriving(Eq)] pub struct bckerr { cmt: cmt, code: bckerr_code @@ -382,7 +382,7 @@ pub enum MoveError { // shorthand for something that fails with `bckerr` or succeeds with `T` pub type bckres = Result; -#[deriving_eq] +#[deriving(Eq)] pub enum LoanKind { TotalFreeze, // Entire path is frozen (borrowed as &T) PartialFreeze, // Some subpath is frozen (borrowed as &T) diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 24e94c7ca6d41..ddc00000c6b4f 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -183,7 +183,7 @@ pub type matrix = ~[~[@pat]]; pub enum useful { useful(ty::t, ctor), useful_, not_useful } -#[deriving_eq] +#[deriving(Eq)] pub enum ctor { single, variant(def_id), diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index ba6348bb1de81..7e0a36be0a020 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -240,7 +240,7 @@ pub fn process_crate(crate: @ast::crate, // FIXME (#33): this doesn't handle big integer/float literals correctly // (nor does the rest of our literal handling). -#[deriving_eq] +#[deriving(Eq)] pub enum const_val { const_float(f64), const_int(i64), diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 3edceebba0cc0..c95ec0f30831d 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -60,7 +60,7 @@ use syntax::{ast, ast_util, visit}; * process. */ -#[deriving_eq] +#[deriving(Eq)] pub enum lint { ctypes, unused_imports, @@ -99,7 +99,7 @@ pub fn level_to_str(lv: level) -> &'static str { } } -#[deriving_eq] +#[deriving(Eq)] pub enum level { allow, warn, deny, forbid } diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index a471d91877a62..d85570444d825 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -60,7 +60,7 @@ use syntax::ast; use syntax::codemap::span; use syntax::print::pprust; -#[deriving_eq] +#[deriving(Eq)] pub enum categorization { cat_rvalue, // result of eval'ing some misc expr cat_special(special_kind), // @@ -75,7 +75,7 @@ pub enum categorization { } // different kinds of pointers: -#[deriving_eq] +#[deriving(Eq)] pub enum ptr_kind { uniq_ptr, gc_ptr(ast::mutability), @@ -85,7 +85,7 @@ pub enum ptr_kind { // I am coining the term "components" to mean "pieces of a data // structure accessible without a dereference": -#[deriving_eq] +#[deriving(Eq)] pub enum comp_kind { comp_tuple, // elt in a tuple comp_anon_field, // anonymous field (in e.g. @@ -98,7 +98,7 @@ pub enum comp_kind { } // different kinds of expressions we might evaluate -#[deriving_eq] +#[deriving(Eq)] pub enum special_kind { sk_method, sk_static_item, @@ -106,7 +106,7 @@ pub enum special_kind { sk_heap_upvar } -#[deriving_eq] +#[deriving(Eq)] pub enum MutabilityCategory { McImmutable, // Immutable. McReadOnly, // Read-only (`const`) @@ -119,7 +119,7 @@ pub enum MutabilityCategory { // which the value is stored. // // note: cmt stands for "categorized mutable type". -#[deriving_eq] +#[deriving(Eq)] pub struct cmt_ { id: ast::node_id, // id of expr/pat producing this value span: span, // span of same expr/pat @@ -134,7 +134,7 @@ pub type cmt = @cmt_; // a loan path is like a category, but it exists only when the data is // interior to the stack frame. loan paths are used as the key to a // map indicating what is borrowed at any point in time. -#[deriving_eq] +#[deriving(Eq)] pub enum loan_path { lp_local(ast::node_id), lp_arg(ast::node_id), diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index 6dcf1ba812863..10838a7a8dc2c 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -389,7 +389,7 @@ pub fn resolve_crate(sess: Session, pub type region_paramd_items = HashMap; -#[deriving_eq] +#[deriving(Eq)] pub struct region_dep { ambient_variance: region_variance, id: ast::node_id diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index f0e7ef0c5899a..1d3a0f8b4b63d 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -122,7 +122,7 @@ pub struct Export2 { reexport: bool, // Whether this is a reexport. } -#[deriving_eq] +#[deriving(Eq)] pub enum PatternBindingMode { RefutableMode, LocalIrrefutableMode, @@ -166,7 +166,7 @@ pub enum NameDefinition { } -#[deriving_eq] +#[deriving(Eq)] pub enum Mutability { Mutable, Immutable @@ -179,7 +179,7 @@ pub enum SelfBinding { pub type ResolveVisitor = vt<()>; -#[deriving_eq] +#[deriving(Eq)] pub enum ImportDirectiveNS { TypeNSOnly, AnyNS @@ -271,7 +271,7 @@ pub enum MethodSort { // FIXME #4947: The X-ray flag is kind of questionable in the first // place. It might be better to introduce an expr_xray_path instead. -#[deriving_eq] +#[deriving(Eq)] pub enum XrayFlag { NoXray, //< Private items cannot be accessed. Xray //< Private items can be accessed. @@ -292,13 +292,13 @@ pub enum ModulePrefixResult { PrefixFound(@mut Module, uint) } -#[deriving_eq] +#[deriving(Eq)] pub enum AllowCapturingSelfFlag { AllowCapturingSelf, //< The "self" definition can be captured. DontAllowCapturingSelf, //< The "self" definition cannot be captured. } -#[deriving_eq] +#[deriving(Eq)] enum NameSearchType { SearchItemsAndPublicImports, //< Search items and public imports. SearchItemsAndAllImports, //< Search items and all imports. @@ -312,7 +312,7 @@ pub enum BareIdentifierPatternResolution { // Specifies how duplicates should be handled when adding a child item if // another item exists with the same name in some namespace. -#[deriving_eq] +#[deriving(Eq)] pub enum DuplicateCheckingMode { ForbidDuplicateModules, ForbidDuplicateTypes, diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index 09f0a4f547a03..a529fd669394a 100644 --- a/src/librustc/middle/trans/_match.rs +++ b/src/librustc/middle/trans/_match.rs @@ -1037,7 +1037,7 @@ pub fn pick_col(m: &[@Match]) -> uint { return best_col; } -#[deriving_eq] +#[deriving(Eq)] pub enum branch_kind { no_branch, single, switch, compare, compare_vec_len, } // Compiles a comparison between two things. diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index 8ffccff54b8d8..112d42d8f57e6 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -335,14 +335,14 @@ pub fn warn_not_to_commit(ccx: @CrateContext, msg: &str) { } // Heap selectors. Indicate which heap something should go on. -#[deriving_eq] +#[deriving(Eq)] pub enum heap { heap_managed, heap_managed_unique, heap_exchange, } -#[deriving_eq] +#[deriving(Eq)] pub enum cleantype { normal_exit_only, normal_exit_and_unwind @@ -1270,7 +1270,7 @@ pub fn is_undef(val: ValueRef) -> bool { } // Used to identify cached monomorphized functions and vtables -#[deriving_eq] +#[deriving(Eq)] pub enum mono_param_id { mono_precise(ty::t, Option<~[mono_id]>), mono_any, @@ -1280,7 +1280,7 @@ pub enum mono_param_id { datum::DatumMode), } -#[deriving_eq] +#[deriving(Eq)] pub struct mono_id_ { def: ast::def_id, params: ~[mono_param_id], diff --git a/src/librustc/middle/trans/datum.rs b/src/librustc/middle/trans/datum.rs index 9b3ec5ef842e6..08ed83a9634bb 100644 --- a/src/librustc/middle/trans/datum.rs +++ b/src/librustc/middle/trans/datum.rs @@ -110,7 +110,7 @@ use core::uint; use syntax::ast; use syntax::parse::token::special_idents; -#[deriving_eq] +#[deriving(Eq)] pub enum CopyAction { INIT, DROP_EXISTING @@ -171,7 +171,7 @@ impl to_bytes::IterBytes for DatumMode { } /// See `Datum cleanup styles` section at the head of this module. -#[deriving_eq] +#[deriving(Eq)] pub enum DatumCleanup { RevokeClean, ZeroMem diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index be5dd8af9d730..065942b8fe63b 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -54,13 +54,13 @@ use syntax; // Note: after typeck, you should use resolved_mode() to convert this mode // into an rmode, which will take into account the results of mode inference. -#[deriving_eq] +#[deriving(Eq)] pub struct arg { mode: ast::mode, ty: t } -#[deriving_eq] +#[deriving(Eq)] pub struct field { ident: ast::ident, mt: mt @@ -84,7 +84,7 @@ pub struct mt { #[auto_encode] #[auto_decode] -#[deriving_eq] +#[deriving(Eq)] pub enum vstore { vstore_fixed(uint), vstore_uniq, @@ -94,7 +94,7 @@ pub enum vstore { #[auto_encode] #[auto_decode] -#[deriving_eq] +#[deriving(Eq)] pub enum TraitStore { BareTraitStore, // a plain trait without a sigil BoxTraitStore, // @Trait @@ -111,7 +111,7 @@ pub struct field_ty { // Contains information needed to resolve types and (in the future) look up // the types of AST nodes. -#[deriving_eq] +#[deriving(Eq)] pub struct creader_cache_key { cnum: int, pos: uint, @@ -131,7 +131,7 @@ struct intern_key { o_def_id: Option } -// NB: Do not replace this with #[deriving_eq]. The automatically-derived +// NB: Do not replace this with #[deriving(Eq)]. The automatically-derived // implementation will not recurse through sty and you will get stack // exhaustion. impl cmp::Eq for intern_key { @@ -359,14 +359,14 @@ pub pure fn type_has_regions(t: t) -> bool { pub pure fn type_def_id(t: t) -> Option { get(t).o_def_id } pub pure fn type_id(t: t) -> uint { get(t).id } -#[deriving_eq] +#[deriving(Eq)] pub struct BareFnTy { purity: ast::purity, abi: Abi, sig: FnSig } -#[deriving_eq] +#[deriving(Eq)] pub struct ClosureTy { purity: ast::purity, sigil: ast::Sigil, @@ -381,7 +381,7 @@ pub struct ClosureTy { * * - `inputs` is the list of arguments and their modes. * - `output` is the return type. */ -#[deriving_eq] +#[deriving(Eq)] pub struct FnSig { inputs: ~[arg], output: t @@ -400,7 +400,7 @@ impl to_bytes::IterBytes for ClosureTy { } } -#[deriving_eq] +#[deriving(Eq)] pub struct param_ty { idx: uint, def_id: def_id @@ -489,7 +489,7 @@ type opt_region = Option; * - `self_ty` is the type to which `self` should be remapped, if any. The * `self` type is rather funny in that it can only appear on traits and is * always substituted away to the implementing type for a trait. */ -#[deriving_eq] +#[deriving(Eq)] pub struct substs { self_r: opt_region, self_ty: Option, @@ -498,7 +498,7 @@ pub struct substs { // NB: If you change this, you'll probably want to change the corresponding // AST structure in libsyntax/ast.rs as well. -#[deriving_eq] +#[deriving(Eq)] pub enum sty { ty_nil, ty_bot, @@ -535,7 +535,7 @@ pub enum sty { ty_unboxed_vec(mt), } -#[deriving_eq] +#[deriving(Eq)] pub enum IntVarValue { IntType(ast::int_ty), UintType(ast::uint_ty), @@ -592,23 +592,23 @@ pub enum param_bound { bound_trait(t), } -#[deriving_eq] +#[deriving(Eq)] pub struct TyVid(uint); -#[deriving_eq] +#[deriving(Eq)] pub struct IntVid(uint); -#[deriving_eq] +#[deriving(Eq)] pub struct FloatVid(uint); -#[deriving_eq] +#[deriving(Eq)] #[auto_encode] #[auto_decode] pub struct RegionVid { id: uint } -#[deriving_eq] +#[deriving(Eq)] pub enum InferTy { TyVar(TyVid), IntVar(IntVid), diff --git a/src/librustc/middle/typeck/check/method.rs b/src/librustc/middle/typeck/check/method.rs index adcc94086947a..2973492cac4b9 100644 --- a/src/librustc/middle/typeck/check/method.rs +++ b/src/librustc/middle/typeck/check/method.rs @@ -105,13 +105,13 @@ use syntax::ast::{m_const, m_mutbl, m_imm}; use syntax::ast; use syntax::ast_map; -#[deriving_eq] +#[deriving(Eq)] pub enum CheckTraitsFlag { CheckTraitsOnly, CheckTraitsAndInherentMethods, } -#[deriving_eq] +#[deriving(Eq)] pub enum AutoderefReceiverFlag { AutoderefReceiver, DontAutoderefReceiver, diff --git a/src/librustc/middle/typeck/infer/region_inference.rs b/src/librustc/middle/typeck/infer/region_inference.rs index 534e50e115f78..df309bcec2fa2 100644 --- a/src/librustc/middle/typeck/infer/region_inference.rs +++ b/src/librustc/middle/typeck/infer/region_inference.rs @@ -1175,10 +1175,10 @@ priv impl RegionVarBindings { // ______________________________________________________________________ -#[deriving_eq] +#[deriving(Eq)] enum Direction { Incoming = 0, Outgoing = 1 } -#[deriving_eq] +#[deriving(Eq)] enum Classification { Expanding, Contracting } enum GraphNodeValue { NoValue, Value(Region), ErrorValue } diff --git a/src/librustc/rustc.rc b/src/librustc/rustc.rc index 296c94f3299cb..60248687f3f98 100644 --- a/src/librustc/rustc.rc +++ b/src/librustc/rustc.rc @@ -286,7 +286,7 @@ pub fn run_compiler(args: &~[~str], demitter: diagnostic::Emitter) { compile_input(sess, cfg, input, &odir, &ofile); } -#[deriving_eq] +#[deriving(Eq)] pub enum monitor_msg { fatal, done,