rustc: replace uses of old deriving attribute with new one

This commit is contained in:
Andrew Paseltiner 2013-03-20 11:40:02 -04:00
parent 72d7d60155
commit 9966eaaba4
20 changed files with 62 additions and 62 deletions

View File

@ -38,7 +38,7 @@ use syntax::ast_map::{path, path_mod, path_name};
use syntax::attr; use syntax::attr;
use syntax::print::pprust; use syntax::print::pprust;
#[deriving_eq] #[deriving(Eq)]
pub enum output_type { pub enum output_type {
output_type_none, output_type_none,
output_type_bitcode, output_type_bitcode,

View File

@ -161,7 +161,7 @@ pub fn parse_input(sess: Session, +cfg: ast::crate_cfg, input: input)
} }
} }
#[deriving_eq] #[deriving(Eq)]
pub enum compile_upto { pub enum compile_upto {
cu_parse, cu_parse,
cu_expand, cu_expand,

View File

@ -27,10 +27,10 @@ use syntax::parse::ParseSess;
use syntax::{ast, codemap}; use syntax::{ast, codemap};
use syntax; use syntax;
#[deriving_eq] #[deriving(Eq)]
pub enum os { os_win32, os_macos, os_linux, os_android, os_freebsd, } 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 arch { arch_x86, arch_x86_64, arch_arm, arch_mips, }
pub enum crate_type { bin_crate, lib_crate, unknown_crate, } 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 { pub enum OptLevel {
No, // -O0 No, // -O0
Less, // -O1 Less, // -O1

View File

@ -127,7 +127,7 @@ pub enum RealPredicate {
// enum for the LLVM TypeKind type - must stay in sync with the def of // enum for the LLVM TypeKind type - must stay in sync with the def of
// LLVMTypeKind in llvm/include/llvm-c/Core.h // LLVMTypeKind in llvm/include/llvm-c/Core.h
#[deriving_eq] #[deriving(Eq)]
pub enum TypeKind { pub enum TypeKind {
Void = 0, Void = 0,
Half = 1, Half = 1,

View File

@ -93,7 +93,7 @@ fn lookup_item(item_id: int, data: @~[u8]) -> ebml::Doc {
} }
} }
#[deriving_eq] #[deriving(Eq)]
enum Family { enum Family {
Const, // c Const, // c
Fn, // f Fn, // f

View File

@ -51,7 +51,7 @@ struct CheckLoanCtxt {
} }
// if we are enforcing purity, why are we doing so? // if we are enforcing purity, why are we doing so?
#[deriving_eq] #[deriving(Eq)]
enum purity_cause { enum purity_cause {
// enforcing purity because fn was declared pure: // enforcing purity because fn was declared pure:
pc_pure_fn, pc_pure_fn,
@ -80,7 +80,7 @@ pub fn check_loans(bccx: @BorrowckCtxt,
visit::visit_crate(*crate, clcx, vt); visit::visit_crate(*crate, clcx, vt);
} }
#[deriving_eq] #[deriving(Eq)]
enum assignment_type { enum assignment_type {
at_straight_up, at_straight_up,
at_swap at_swap

View File

@ -340,7 +340,7 @@ pub type root_map = HashMap<root_map_key, RootInfo>;
// if you have an expression `x.f` and x has type ~@T, we could add an // 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}` // 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. // to refer to the deref of the unique pointer, and so on.
#[deriving_eq] #[deriving(Eq)]
pub struct root_map_key { pub struct root_map_key {
id: ast::node_id, id: ast::node_id,
derefs: uint derefs: uint
@ -355,7 +355,7 @@ pub type mutbl_map = HashMap<ast::node_id, ()>;
pub type write_guard_map = HashMap<root_map_key, ()>; pub type write_guard_map = HashMap<root_map_key, ()>;
// Errors that can occur // Errors that can occur
#[deriving_eq] #[deriving(Eq)]
pub enum bckerr_code { pub enum bckerr_code {
err_mut_uniq, err_mut_uniq,
err_mut_variant, err_mut_variant,
@ -367,7 +367,7 @@ pub enum bckerr_code {
// Combination of an error code and the categorization of the expression // Combination of an error code and the categorization of the expression
// that caused it // that caused it
#[deriving_eq] #[deriving(Eq)]
pub struct bckerr { pub struct bckerr {
cmt: cmt, cmt: cmt,
code: bckerr_code code: bckerr_code
@ -382,7 +382,7 @@ pub enum MoveError {
// shorthand for something that fails with `bckerr` or succeeds with `T` // shorthand for something that fails with `bckerr` or succeeds with `T`
pub type bckres<T> = Result<T, bckerr>; pub type bckres<T> = Result<T, bckerr>;
#[deriving_eq] #[deriving(Eq)]
pub enum LoanKind { pub enum LoanKind {
TotalFreeze, // Entire path is frozen (borrowed as &T) TotalFreeze, // Entire path is frozen (borrowed as &T)
PartialFreeze, // Some subpath is frozen (borrowed as &T) PartialFreeze, // Some subpath is frozen (borrowed as &T)

View File

@ -183,7 +183,7 @@ pub type matrix = ~[~[@pat]];
pub enum useful { useful(ty::t, ctor), useful_, not_useful } pub enum useful { useful(ty::t, ctor), useful_, not_useful }
#[deriving_eq] #[deriving(Eq)]
pub enum ctor { pub enum ctor {
single, single,
variant(def_id), variant(def_id),

View File

@ -240,7 +240,7 @@ pub fn process_crate(crate: @ast::crate,
// FIXME (#33): this doesn't handle big integer/float literals correctly // FIXME (#33): this doesn't handle big integer/float literals correctly
// (nor does the rest of our literal handling). // (nor does the rest of our literal handling).
#[deriving_eq] #[deriving(Eq)]
pub enum const_val { pub enum const_val {
const_float(f64), const_float(f64),
const_int(i64), const_int(i64),

View File

@ -60,7 +60,7 @@ use syntax::{ast, ast_util, visit};
* process. * process.
*/ */
#[deriving_eq] #[deriving(Eq)]
pub enum lint { pub enum lint {
ctypes, ctypes,
unused_imports, unused_imports,
@ -99,7 +99,7 @@ pub fn level_to_str(lv: level) -> &'static str {
} }
} }
#[deriving_eq] #[deriving(Eq)]
pub enum level { pub enum level {
allow, warn, deny, forbid allow, warn, deny, forbid
} }

View File

@ -60,7 +60,7 @@ use syntax::ast;
use syntax::codemap::span; use syntax::codemap::span;
use syntax::print::pprust; use syntax::print::pprust;
#[deriving_eq] #[deriving(Eq)]
pub enum categorization { pub enum categorization {
cat_rvalue, // result of eval'ing some misc expr cat_rvalue, // result of eval'ing some misc expr
cat_special(special_kind), // cat_special(special_kind), //
@ -75,7 +75,7 @@ pub enum categorization {
} }
// different kinds of pointers: // different kinds of pointers:
#[deriving_eq] #[deriving(Eq)]
pub enum ptr_kind { pub enum ptr_kind {
uniq_ptr, uniq_ptr,
gc_ptr(ast::mutability), gc_ptr(ast::mutability),
@ -85,7 +85,7 @@ pub enum ptr_kind {
// I am coining the term "components" to mean "pieces of a data // I am coining the term "components" to mean "pieces of a data
// structure accessible without a dereference": // structure accessible without a dereference":
#[deriving_eq] #[deriving(Eq)]
pub enum comp_kind { pub enum comp_kind {
comp_tuple, // elt in a tuple comp_tuple, // elt in a tuple
comp_anon_field, // anonymous field (in e.g. comp_anon_field, // anonymous field (in e.g.
@ -98,7 +98,7 @@ pub enum comp_kind {
} }
// different kinds of expressions we might evaluate // different kinds of expressions we might evaluate
#[deriving_eq] #[deriving(Eq)]
pub enum special_kind { pub enum special_kind {
sk_method, sk_method,
sk_static_item, sk_static_item,
@ -106,7 +106,7 @@ pub enum special_kind {
sk_heap_upvar sk_heap_upvar
} }
#[deriving_eq] #[deriving(Eq)]
pub enum MutabilityCategory { pub enum MutabilityCategory {
McImmutable, // Immutable. McImmutable, // Immutable.
McReadOnly, // Read-only (`const`) McReadOnly, // Read-only (`const`)
@ -119,7 +119,7 @@ pub enum MutabilityCategory {
// which the value is stored. // which the value is stored.
// //
// note: cmt stands for "categorized mutable type". // note: cmt stands for "categorized mutable type".
#[deriving_eq] #[deriving(Eq)]
pub struct cmt_ { pub struct cmt_ {
id: ast::node_id, // id of expr/pat producing this value id: ast::node_id, // id of expr/pat producing this value
span: span, // span of same expr/pat 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 // 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 // interior to the stack frame. loan paths are used as the key to a
// map indicating what is borrowed at any point in time. // map indicating what is borrowed at any point in time.
#[deriving_eq] #[deriving(Eq)]
pub enum loan_path { pub enum loan_path {
lp_local(ast::node_id), lp_local(ast::node_id),
lp_arg(ast::node_id), lp_arg(ast::node_id),

View File

@ -389,7 +389,7 @@ pub fn resolve_crate(sess: Session,
pub type region_paramd_items = HashMap<ast::node_id, region_variance>; pub type region_paramd_items = HashMap<ast::node_id, region_variance>;
#[deriving_eq] #[deriving(Eq)]
pub struct region_dep { pub struct region_dep {
ambient_variance: region_variance, ambient_variance: region_variance,
id: ast::node_id id: ast::node_id

View File

@ -122,7 +122,7 @@ pub struct Export2 {
reexport: bool, // Whether this is a reexport. reexport: bool, // Whether this is a reexport.
} }
#[deriving_eq] #[deriving(Eq)]
pub enum PatternBindingMode { pub enum PatternBindingMode {
RefutableMode, RefutableMode,
LocalIrrefutableMode, LocalIrrefutableMode,
@ -166,7 +166,7 @@ pub enum NameDefinition {
} }
#[deriving_eq] #[deriving(Eq)]
pub enum Mutability { pub enum Mutability {
Mutable, Mutable,
Immutable Immutable
@ -179,7 +179,7 @@ pub enum SelfBinding {
pub type ResolveVisitor = vt<()>; pub type ResolveVisitor = vt<()>;
#[deriving_eq] #[deriving(Eq)]
pub enum ImportDirectiveNS { pub enum ImportDirectiveNS {
TypeNSOnly, TypeNSOnly,
AnyNS AnyNS
@ -271,7 +271,7 @@ pub enum MethodSort {
// FIXME #4947: The X-ray flag is kind of questionable in the first // 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. // place. It might be better to introduce an expr_xray_path instead.
#[deriving_eq] #[deriving(Eq)]
pub enum XrayFlag { pub enum XrayFlag {
NoXray, //< Private items cannot be accessed. NoXray, //< Private items cannot be accessed.
Xray //< Private items can be accessed. Xray //< Private items can be accessed.
@ -292,13 +292,13 @@ pub enum ModulePrefixResult {
PrefixFound(@mut Module, uint) PrefixFound(@mut Module, uint)
} }
#[deriving_eq] #[deriving(Eq)]
pub enum AllowCapturingSelfFlag { pub enum AllowCapturingSelfFlag {
AllowCapturingSelf, //< The "self" definition can be captured. AllowCapturingSelf, //< The "self" definition can be captured.
DontAllowCapturingSelf, //< The "self" definition cannot be captured. DontAllowCapturingSelf, //< The "self" definition cannot be captured.
} }
#[deriving_eq] #[deriving(Eq)]
enum NameSearchType { enum NameSearchType {
SearchItemsAndPublicImports, //< Search items and public imports. SearchItemsAndPublicImports, //< Search items and public imports.
SearchItemsAndAllImports, //< Search items and all 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 // Specifies how duplicates should be handled when adding a child item if
// another item exists with the same name in some namespace. // another item exists with the same name in some namespace.
#[deriving_eq] #[deriving(Eq)]
pub enum DuplicateCheckingMode { pub enum DuplicateCheckingMode {
ForbidDuplicateModules, ForbidDuplicateModules,
ForbidDuplicateTypes, ForbidDuplicateTypes,

View File

@ -1037,7 +1037,7 @@ pub fn pick_col(m: &[@Match]) -> uint {
return best_col; return best_col;
} }
#[deriving_eq] #[deriving(Eq)]
pub enum branch_kind { no_branch, single, switch, compare, compare_vec_len, } pub enum branch_kind { no_branch, single, switch, compare, compare_vec_len, }
// Compiles a comparison between two things. // Compiles a comparison between two things.

View File

@ -335,14 +335,14 @@ pub fn warn_not_to_commit(ccx: @CrateContext, msg: &str) {
} }
// Heap selectors. Indicate which heap something should go on. // Heap selectors. Indicate which heap something should go on.
#[deriving_eq] #[deriving(Eq)]
pub enum heap { pub enum heap {
heap_managed, heap_managed,
heap_managed_unique, heap_managed_unique,
heap_exchange, heap_exchange,
} }
#[deriving_eq] #[deriving(Eq)]
pub enum cleantype { pub enum cleantype {
normal_exit_only, normal_exit_only,
normal_exit_and_unwind normal_exit_and_unwind
@ -1270,7 +1270,7 @@ pub fn is_undef(val: ValueRef) -> bool {
} }
// Used to identify cached monomorphized functions and vtables // Used to identify cached monomorphized functions and vtables
#[deriving_eq] #[deriving(Eq)]
pub enum mono_param_id { pub enum mono_param_id {
mono_precise(ty::t, Option<~[mono_id]>), mono_precise(ty::t, Option<~[mono_id]>),
mono_any, mono_any,
@ -1280,7 +1280,7 @@ pub enum mono_param_id {
datum::DatumMode), datum::DatumMode),
} }
#[deriving_eq] #[deriving(Eq)]
pub struct mono_id_ { pub struct mono_id_ {
def: ast::def_id, def: ast::def_id,
params: ~[mono_param_id], params: ~[mono_param_id],

View File

@ -110,7 +110,7 @@ use core::uint;
use syntax::ast; use syntax::ast;
use syntax::parse::token::special_idents; use syntax::parse::token::special_idents;
#[deriving_eq] #[deriving(Eq)]
pub enum CopyAction { pub enum CopyAction {
INIT, INIT,
DROP_EXISTING DROP_EXISTING
@ -171,7 +171,7 @@ impl to_bytes::IterBytes for DatumMode {
} }
/// See `Datum cleanup styles` section at the head of this module. /// See `Datum cleanup styles` section at the head of this module.
#[deriving_eq] #[deriving(Eq)]
pub enum DatumCleanup { pub enum DatumCleanup {
RevokeClean, RevokeClean,
ZeroMem ZeroMem

View File

@ -54,13 +54,13 @@ use syntax;
// Note: after typeck, you should use resolved_mode() to convert this mode // 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. // into an rmode, which will take into account the results of mode inference.
#[deriving_eq] #[deriving(Eq)]
pub struct arg { pub struct arg {
mode: ast::mode, mode: ast::mode,
ty: t ty: t
} }
#[deriving_eq] #[deriving(Eq)]
pub struct field { pub struct field {
ident: ast::ident, ident: ast::ident,
mt: mt mt: mt
@ -84,7 +84,7 @@ pub struct mt {
#[auto_encode] #[auto_encode]
#[auto_decode] #[auto_decode]
#[deriving_eq] #[deriving(Eq)]
pub enum vstore { pub enum vstore {
vstore_fixed(uint), vstore_fixed(uint),
vstore_uniq, vstore_uniq,
@ -94,7 +94,7 @@ pub enum vstore {
#[auto_encode] #[auto_encode]
#[auto_decode] #[auto_decode]
#[deriving_eq] #[deriving(Eq)]
pub enum TraitStore { pub enum TraitStore {
BareTraitStore, // a plain trait without a sigil BareTraitStore, // a plain trait without a sigil
BoxTraitStore, // @Trait BoxTraitStore, // @Trait
@ -111,7 +111,7 @@ pub struct field_ty {
// Contains information needed to resolve types and (in the future) look up // Contains information needed to resolve types and (in the future) look up
// the types of AST nodes. // the types of AST nodes.
#[deriving_eq] #[deriving(Eq)]
pub struct creader_cache_key { pub struct creader_cache_key {
cnum: int, cnum: int,
pos: uint, pos: uint,
@ -131,7 +131,7 @@ struct intern_key {
o_def_id: Option<ast::def_id> o_def_id: Option<ast::def_id>
} }
// 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 // implementation will not recurse through sty and you will get stack
// exhaustion. // exhaustion.
impl cmp::Eq for intern_key { 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<ast::def_id> { get(t).o_def_id } pub pure fn type_def_id(t: t) -> Option<ast::def_id> { get(t).o_def_id }
pub pure fn type_id(t: t) -> uint { get(t).id } pub pure fn type_id(t: t) -> uint { get(t).id }
#[deriving_eq] #[deriving(Eq)]
pub struct BareFnTy { pub struct BareFnTy {
purity: ast::purity, purity: ast::purity,
abi: Abi, abi: Abi,
sig: FnSig sig: FnSig
} }
#[deriving_eq] #[deriving(Eq)]
pub struct ClosureTy { pub struct ClosureTy {
purity: ast::purity, purity: ast::purity,
sigil: ast::Sigil, sigil: ast::Sigil,
@ -381,7 +381,7 @@ pub struct ClosureTy {
* *
* - `inputs` is the list of arguments and their modes. * - `inputs` is the list of arguments and their modes.
* - `output` is the return type. */ * - `output` is the return type. */
#[deriving_eq] #[deriving(Eq)]
pub struct FnSig { pub struct FnSig {
inputs: ~[arg], inputs: ~[arg],
output: t output: t
@ -400,7 +400,7 @@ impl to_bytes::IterBytes for ClosureTy {
} }
} }
#[deriving_eq] #[deriving(Eq)]
pub struct param_ty { pub struct param_ty {
idx: uint, idx: uint,
def_id: def_id def_id: def_id
@ -489,7 +489,7 @@ type opt_region = Option<Region>;
* - `self_ty` is the type to which `self` should be remapped, if any. The * - `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 * `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. */ * always substituted away to the implementing type for a trait. */
#[deriving_eq] #[deriving(Eq)]
pub struct substs { pub struct substs {
self_r: opt_region, self_r: opt_region,
self_ty: Option<ty::t>, self_ty: Option<ty::t>,
@ -498,7 +498,7 @@ pub struct substs {
// NB: If you change this, you'll probably want to change the corresponding // NB: If you change this, you'll probably want to change the corresponding
// AST structure in libsyntax/ast.rs as well. // AST structure in libsyntax/ast.rs as well.
#[deriving_eq] #[deriving(Eq)]
pub enum sty { pub enum sty {
ty_nil, ty_nil,
ty_bot, ty_bot,
@ -535,7 +535,7 @@ pub enum sty {
ty_unboxed_vec(mt), ty_unboxed_vec(mt),
} }
#[deriving_eq] #[deriving(Eq)]
pub enum IntVarValue { pub enum IntVarValue {
IntType(ast::int_ty), IntType(ast::int_ty),
UintType(ast::uint_ty), UintType(ast::uint_ty),
@ -592,23 +592,23 @@ pub enum param_bound {
bound_trait(t), bound_trait(t),
} }
#[deriving_eq] #[deriving(Eq)]
pub struct TyVid(uint); pub struct TyVid(uint);
#[deriving_eq] #[deriving(Eq)]
pub struct IntVid(uint); pub struct IntVid(uint);
#[deriving_eq] #[deriving(Eq)]
pub struct FloatVid(uint); pub struct FloatVid(uint);
#[deriving_eq] #[deriving(Eq)]
#[auto_encode] #[auto_encode]
#[auto_decode] #[auto_decode]
pub struct RegionVid { pub struct RegionVid {
id: uint id: uint
} }
#[deriving_eq] #[deriving(Eq)]
pub enum InferTy { pub enum InferTy {
TyVar(TyVid), TyVar(TyVid),
IntVar(IntVid), IntVar(IntVid),

View File

@ -105,13 +105,13 @@ use syntax::ast::{m_const, m_mutbl, m_imm};
use syntax::ast; use syntax::ast;
use syntax::ast_map; use syntax::ast_map;
#[deriving_eq] #[deriving(Eq)]
pub enum CheckTraitsFlag { pub enum CheckTraitsFlag {
CheckTraitsOnly, CheckTraitsOnly,
CheckTraitsAndInherentMethods, CheckTraitsAndInherentMethods,
} }
#[deriving_eq] #[deriving(Eq)]
pub enum AutoderefReceiverFlag { pub enum AutoderefReceiverFlag {
AutoderefReceiver, AutoderefReceiver,
DontAutoderefReceiver, DontAutoderefReceiver,

View File

@ -1175,10 +1175,10 @@ priv impl RegionVarBindings {
// ______________________________________________________________________ // ______________________________________________________________________
#[deriving_eq] #[deriving(Eq)]
enum Direction { Incoming = 0, Outgoing = 1 } enum Direction { Incoming = 0, Outgoing = 1 }
#[deriving_eq] #[deriving(Eq)]
enum Classification { Expanding, Contracting } enum Classification { Expanding, Contracting }
enum GraphNodeValue { NoValue, Value(Region), ErrorValue } enum GraphNodeValue { NoValue, Value(Region), ErrorValue }

View File

@ -286,7 +286,7 @@ pub fn run_compiler(args: &~[~str], demitter: diagnostic::Emitter) {
compile_input(sess, cfg, input, &odir, &ofile); compile_input(sess, cfg, input, &odir, &ofile);
} }
#[deriving_eq] #[deriving(Eq)]
pub enum monitor_msg { pub enum monitor_msg {
fatal, fatal,
done, done,