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::print::pprust;
#[deriving_eq]
#[deriving(Eq)]
pub enum output_type {
output_type_none,
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 {
cu_parse,
cu_expand,

View File

@ -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

View File

@ -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,

View File

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

View File

@ -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

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
// 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<ast::node_id, ()>;
pub type write_guard_map = HashMap<root_map_key, ()>;
// 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<T> = Result<T, bckerr>;
#[deriving_eq]
#[deriving(Eq)]
pub enum LoanKind {
TotalFreeze, // Entire path 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 }
#[deriving_eq]
#[deriving(Eq)]
pub enum ctor {
single,
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
// (nor does the rest of our literal handling).
#[deriving_eq]
#[deriving(Eq)]
pub enum const_val {
const_float(f64),
const_int(i64),

View File

@ -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
}

View File

@ -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),

View File

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

View File

@ -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,

View File

@ -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.

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.
#[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],

View File

@ -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

View File

@ -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<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
// 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<ast::def_id> { 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<Region>;
* - `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<ty::t>,
@ -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),

View File

@ -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,

View File

@ -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 }

View File

@ -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,