Skip to content

Commit

Permalink
auto merge of #5493 : apasel422/rust/leibniz, r=bstrie
Browse files Browse the repository at this point in the history
Closes #5411.
  • Loading branch information
bors committed Mar 22, 2013
2 parents 9584c60 + 999e7ef commit 0597647
Show file tree
Hide file tree
Showing 81 changed files with 297 additions and 252 deletions.
2 changes: 1 addition & 1 deletion src/compiletest/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use core::prelude::*;

#[deriving_eq]
#[deriving(Eq)]
pub enum mode {
mode_compile_fail,
mode_run_fail,
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub trait Eq {
pure fn ne(&self, other: &Self) -> bool;
}

#[deriving_eq]
#[deriving(Eq)]
pub enum Ordering { Less, Equal, Greater }

/// Trait for types that form a total order
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/either.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use result;
use vec;

/// The either type
#[deriving_eq]
#[deriving(Eq)]
pub enum Either<T, U> {
Left(T),
Right(U)
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ pub pure fn with_str_reader<T>(s: &str, f: &fn(@Reader) -> T) -> T {
pub enum FileFlag { Append, Create, Truncate, NoFlag, }
// What type of writer are we?
#[deriving_eq]
#[deriving(Eq)]
pub enum WriterType { Screen, File }
// FIXME (#2004): Seekable really should be orthogonal.
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use iter::{BaseIter, MutableIter};
#[cfg(test)] use str;

/// The option type
#[deriving_eq]
#[deriving(Eq)]
pub enum Option<T> {
None,
Some(T),
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use option::{None, Option, Some};
use str;
use to_str::ToStr;

#[deriving_eq]
#[deriving(Eq)]
pub struct WindowsPath {
host: Option<~str>,
device: Option<~str>,
Expand All @@ -32,7 +32,7 @@ pub pure fn WindowsPath(s: &str) -> WindowsPath {
GenericPath::from_str(s)
}

#[deriving_eq]
#[deriving(Eq)]
pub struct PosixPath {
is_absolute: bool,
components: ~[~str],
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use option::{None, Option, Some};
use vec;

/// The result type
#[deriving_eq]
#[deriving(Eq)]
pub enum Result<T, U> {
/// Contains the successful result value
Ok(T),
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ pub mod rt;
pub mod spawn;

/// A handle to a scheduler
#[deriving_eq]
#[deriving(Eq)]
pub enum Scheduler {
SchedulerHandle(sched_id)
}

/// A handle to a task
#[deriving_eq]
#[deriving(Eq)]
pub enum Task {
TaskHandle(task_id)
}
Expand Down Expand Up @@ -88,7 +88,7 @@ impl Eq for TaskResult {
}

/// Scheduler modes
#[deriving_eq]
#[deriving(Eq)]
pub enum SchedMode {
/// Run task on the default scheduler
DefaultScheduler,
Expand Down
18 changes: 9 additions & 9 deletions src/libcore/unstable/extfmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ pub mod ct {
use prelude::*;
use str;

#[deriving_eq]
#[deriving(Eq)]
pub enum Signedness { Signed, Unsigned, }

#[deriving_eq]
#[deriving(Eq)]
pub enum Caseness { CaseUpper, CaseLower, }

#[deriving_eq]
#[deriving(Eq)]
pub enum Ty {
TyBool,
TyStr,
Expand All @@ -116,7 +116,7 @@ pub mod ct {
TyPoly,
}

#[deriving_eq]
#[deriving(Eq)]
pub enum Flag {
FlagLeftJustify,
FlagLeftZeroPad,
Expand All @@ -125,15 +125,15 @@ pub mod ct {
FlagAlternate,
}

#[deriving_eq]
#[deriving(Eq)]
pub enum Count {
CountIs(uint),
CountIsParam(uint),
CountIsNextParam,
CountImplied,
}

#[deriving_eq]
#[deriving(Eq)]
struct Parsed<T> {
val: T,
next: uint
Expand All @@ -146,7 +146,7 @@ pub mod ct {
}

// A formatted conversion from an expression to a string
#[deriving_eq]
#[deriving(Eq)]
pub struct Conv {
param: Option<uint>,
flags: ~[Flag],
Expand All @@ -156,7 +156,7 @@ pub mod ct {
}

// A fragment of the output sequence
#[deriving_eq]
#[deriving(Eq)]
pub enum Piece { PieceString(~str), PieceConv(Conv), }

pub type ErrorFn = @fn(&str) -> !;
Expand Down Expand Up @@ -596,7 +596,7 @@ pub mod rt {
};
}

#[deriving_eq]
#[deriving(Eq)]
pub enum PadMode { PadSigned, PadUnsigned, PadNozero, PadFloat }

pub fn pad(cv: Conv, s: ~str, mode: PadMode) -> ~str {
Expand Down
2 changes: 1 addition & 1 deletion src/libfuzzer/fuzzer.rc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use syntax::parse;
use syntax::print::pprust;
use syntax::diagnostic;

#[deriving_eq]
#[deriving(Eq)]
pub enum test_mode { tm_converge, tm_run, }

pub struct Context { mode: test_mode } // + rng
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/back/link.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 0597647

Please sign in to comment.