Skip to content

Commit

Permalink
rustc: replace uses of old deriving attribute with new one
Browse files Browse the repository at this point in the history
  • Loading branch information
apasel422 committed Mar 22, 2013
1 parent 72d7d60 commit 9966eaa
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion src/librustc/back/link.rs
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/driver/driver.rs
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/driver/session.rs
Expand Up @@ -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, }
Expand Down Expand Up @@ -104,7 +104,7 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
]
}

#[deriving_eq]
#[deriving(Eq)]
pub enum OptLevel {
No, // -O0
Less, // -O1
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lib/llvm.rs
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/metadata/decoder.rs
Expand Up @@ -93,7 +93,7 @@ fn lookup_item(item_id: int, data: @~[u8]) -> ebml::Doc {
}
}

#[deriving_eq]
#[deriving(Eq)]
enum Family {
Const, // c
Fn, // f
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/borrowck/check_loans.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/borrowck/mod.rs
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/check_match.rs
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/const_eval.rs
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/lint.rs
Expand Up @@ -60,7 +60,7 @@ use syntax::{ast, ast_util, visit};
* process.
*/

#[deriving_eq]
#[deriving(Eq)]
pub enum lint {
ctypes,
unused_imports,
Expand Down Expand Up @@ -99,7 +99,7 @@ pub fn level_to_str(lv: level) -> &'static str {
}
}

#[deriving_eq]
#[deriving(Eq)]
pub enum level {
allow, warn, deny, forbid
}
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/middle/mem_categorization.rs
Expand Up @@ -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), //
Expand All @@ -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),
Expand All @@ -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.
Expand All @@ -98,15 +98,15 @@ pub enum comp_kind {
}

// different kinds of expressions we might evaluate
#[deriving_eq]
#[deriving(Eq)]
pub enum special_kind {
sk_method,
sk_static_item,
sk_implicit_self, // old by-reference `self`
sk_heap_upvar
}

#[deriving_eq]
#[deriving(Eq)]
pub enum MutabilityCategory {
McImmutable, // Immutable.
McReadOnly, // Read-only (`const`)
Expand All @@ -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
Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/region.rs
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/middle/resolve.rs
Expand Up @@ -122,7 +122,7 @@ pub struct Export2 {
reexport: bool, // Whether this is a reexport.
}

#[deriving_eq]
#[deriving(Eq)]
pub enum PatternBindingMode {
RefutableMode,
LocalIrrefutableMode,
Expand Down Expand Up @@ -166,7 +166,7 @@ pub enum NameDefinition {

}

#[deriving_eq]
#[deriving(Eq)]
pub enum Mutability {
Mutable,
Immutable
Expand All @@ -179,7 +179,7 @@ pub enum SelfBinding {

pub type ResolveVisitor = vt<()>;

#[deriving_eq]
#[deriving(Eq)]
pub enum ImportDirectiveNS {
TypeNSOnly,
AnyNS
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/_match.rs
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/trans/common.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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],
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/trans/datum.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9966eaa

Please sign in to comment.