auto merge of : apasel422/rust/leibniz, r=bstrie

Closes .
This commit is contained in:
bors 2013-03-22 05:30:50 -07:00
commit 059764779c
81 changed files with 297 additions and 252 deletions

@ -10,7 +10,7 @@
use core::prelude::*;
#[deriving_eq]
#[deriving(Eq)]
pub enum mode {
mode_compile_fail,
mode_run_fail,

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

@ -17,7 +17,7 @@ use result;
use vec;
/// The either type
#[deriving_eq]
#[deriving(Eq)]
pub enum Either<T, U> {
Left(T),
Right(U)

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

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

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

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

@ -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)
}
@ -88,7 +88,7 @@ impl Eq for TaskResult {
}
/// Scheduler modes
#[deriving_eq]
#[deriving(Eq)]
pub enum SchedMode {
/// Run task on the default scheduler
DefaultScheduler,

@ -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,
@ -116,7 +116,7 @@ pub mod ct {
TyPoly,
}
#[deriving_eq]
#[deriving(Eq)]
pub enum Flag {
FlagLeftJustify,
FlagLeftZeroPad,
@ -125,7 +125,7 @@ pub mod ct {
FlagAlternate,
}
#[deriving_eq]
#[deriving(Eq)]
pub enum Count {
CountIs(uint),
CountIsParam(uint),
@ -133,7 +133,7 @@ pub mod ct {
CountImplied,
}
#[deriving_eq]
#[deriving(Eq)]
struct Parsed<T> {
val: T,
next: uint
@ -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],
@ -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) -> !;
@ -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 {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -19,18 +19,18 @@ use core::vec;
pub type AstId = int;
#[deriving_eq]
#[deriving(Eq)]
pub struct Doc {
pages: ~[Page]
}
#[deriving_eq]
#[deriving(Eq)]
pub enum Page {
CratePage(CrateDoc),
ItemPage(ItemTag)
}
#[deriving_eq]
#[deriving(Eq)]
pub enum Implementation {
Required,
Provided,
@ -40,7 +40,7 @@ pub enum Implementation {
* Most rustdocs can be parsed into 'sections' according to their markdown
* headers
*/
#[deriving_eq]
#[deriving(Eq)]
pub struct Section {
header: ~str,
body: ~str
@ -49,12 +49,12 @@ pub struct Section {
// FIXME (#2596): We currently give topmod the name of the crate. There
// would probably be fewer special cases if the crate had its own name
// and topmod's name was the empty string.
#[deriving_eq]
#[deriving(Eq)]
pub struct CrateDoc {
topmod: ModDoc
}
#[deriving_eq]
#[deriving(Eq)]
pub enum ItemTag {
ModTag(ModDoc),
NmodTag(NmodDoc),
@ -67,7 +67,7 @@ pub enum ItemTag {
StructTag(StructDoc)
}
#[deriving_eq]
#[deriving(Eq)]
pub struct ItemDoc {
id: AstId,
name: ~str,
@ -79,20 +79,20 @@ pub struct ItemDoc {
reexport: bool
}
#[deriving_eq]
#[deriving(Eq)]
pub struct SimpleItemDoc {
item: ItemDoc,
sig: Option<~str>
}
#[deriving_eq]
#[deriving(Eq)]
pub struct ModDoc {
item: ItemDoc,
items: ~[ItemTag],
index: Option<Index>
}
#[deriving_eq]
#[deriving(Eq)]
pub struct NmodDoc {
item: ItemDoc,
fns: ~[FnDoc],
@ -103,26 +103,26 @@ pub type ConstDoc = SimpleItemDoc;
pub type FnDoc = SimpleItemDoc;
#[deriving_eq]
#[deriving(Eq)]
pub struct EnumDoc {
item: ItemDoc,
variants: ~[VariantDoc]
}
#[deriving_eq]
#[deriving(Eq)]
pub struct VariantDoc {
name: ~str,
desc: Option<~str>,
sig: Option<~str>
}
#[deriving_eq]
#[deriving(Eq)]
pub struct TraitDoc {
item: ItemDoc,
methods: ~[MethodDoc]
}
#[deriving_eq]
#[deriving(Eq)]
pub struct MethodDoc {
name: ~str,
brief: Option<~str>,
@ -132,7 +132,7 @@ pub struct MethodDoc {
implementation: Implementation,
}
#[deriving_eq]
#[deriving(Eq)]
pub struct ImplDoc {
item: ItemDoc,
trait_types: ~[~str],
@ -142,14 +142,14 @@ pub struct ImplDoc {
pub type TyDoc = SimpleItemDoc;
#[deriving_eq]
#[deriving(Eq)]
pub struct StructDoc {
item: ItemDoc,
fields: ~[~str],
sig: Option<~str>
}
#[deriving_eq]
#[deriving(Eq)]
pub struct Index {
entries: ~[IndexEntry]
}
@ -164,7 +164,7 @@ pub struct Index {
* * brief - The brief description
* * link - A format-specific string representing the link target
*/
#[deriving_eq]
#[deriving(Eq)]
pub struct IndexEntry {
kind: ~str,
name: ~str,

@ -253,15 +253,15 @@ mod tests {
fail_unless!(*deq.get(3) == d);
}
#[deriving_eq]
#[deriving(Eq)]
enum Taggy { One(int), Two(int, int), Three(int, int, int), }
#[deriving_eq]
#[deriving(Eq)]
enum Taggypar<T> {
Onepar(int), Twopar(int, int), Threepar(int, int, int),
}
#[deriving_eq]
#[deriving(Eq)]
struct RecCy {
x: int,
y: int,

@ -86,20 +86,20 @@ use core::option::{Some, None};
use core::str;
use core::vec;
#[deriving_eq]
#[deriving(Eq)]
pub enum Name {
Long(~str),
Short(char),
}
#[deriving_eq]
#[deriving(Eq)]
pub enum HasArg { Yes, No, Maybe, }
#[deriving_eq]
#[deriving(Eq)]
pub enum Occur { Req, Optional, Multi, }
/// A description of a possible option
#[deriving_eq]
#[deriving(Eq)]
pub struct Opt {
name: Name,
hasarg: HasArg,
@ -146,14 +146,14 @@ pub fn optmulti(name: &str) -> Opt {
return Opt {name: mkname(name), hasarg: Yes, occur: Multi};
}
#[deriving_eq]
#[deriving(Eq)]
enum Optval { Val(~str), Given, }
/**
* The result of checking command line arguments. Contains a vector
* of matches and a vector of free strings.
*/
#[deriving_eq]
#[deriving(Eq)]
pub struct Matches {
opts: ~[Opt],
vals: ~[~[Optval]],
@ -179,7 +179,7 @@ fn find_opt(opts: &[Opt], nm: Name) -> Option<uint> {
* The type returned when the command line does not conform to the
* expected format. Pass this value to <fail_str> to get an error message.
*/
#[deriving_eq]
#[deriving(Eq)]
pub enum Fail_ {
ArgumentMissing(~str),
UnrecognizedOption(~str),
@ -446,7 +446,7 @@ pub fn opt_default(mm: &Matches, nm: &str, def: &str) -> Option<~str> {
_ => Some::<~str>(str::from_slice(def)) }
}
#[deriving_eq]
#[deriving(Eq)]
pub enum FailType {
ArgumentMissing_,
UnrecognizedOption_,
@ -469,7 +469,7 @@ pub mod groups {
/** one group of options, e.g., both -h and --help, along with
* their shared description and properties
*/
#[deriving_eq]
#[deriving(Eq)]
pub struct OptGroup {
short_name: ~str,
long_name: ~str,

@ -15,7 +15,7 @@ use core::option::*;
use core::prelude::*;
use core::vec;
#[deriving_eq]
#[deriving(Eq)]
pub enum List<T> {
Cons(T, @List<T>),
Nil,

@ -25,7 +25,7 @@ use core::to_str::ToStr;
use core::to_str;
use core::uint;
#[deriving_eq]
#[deriving(Eq)]
struct Url {
scheme: ~str,
user: Option<UserInfo>,
@ -36,7 +36,7 @@ struct Url {
fragment: Option<~str>
}
#[deriving_eq]
#[deriving(Eq)]
struct UserInfo {
user: ~str,
pass: Option<~str>
@ -398,7 +398,7 @@ pub pure fn get_scheme(rawurl: &str) -> Result<(~str, ~str), ~str> {
return Err(~"url: Scheme must be terminated with a colon.");
}
#[deriving_eq]
#[deriving(Eq)]
enum Input {
Digit, // all digits
Hex, // digits and letters a-f

@ -19,7 +19,7 @@ use core::str;
use core::to_str::ToStr;
use core::uint;
#[deriving_eq]
#[deriving(Eq)]
pub enum Identifier {
Numeric(uint),
AlphaNumeric(~str)
@ -60,7 +60,7 @@ impl ToStr for Identifier {
}
#[deriving_eq]
#[deriving(Eq)]
pub struct Version {
major: uint,
minor: uint,

@ -188,13 +188,13 @@ pub fn parse_opts(args: &[~str]) -> OptRes {
either::Left(test_opts)
}
#[deriving_eq]
#[deriving(Eq)]
pub struct BenchSamples {
ns_iter_samples: ~[f64],
mb_s: uint
}
#[deriving_eq]
#[deriving(Eq)]
pub enum TestResult { TrOk, TrFailed, TrIgnored, TrBench(BenchSamples) }
struct ConsoleTestState {

@ -96,7 +96,7 @@ use core::mutable::Mut;
*
*/
#[deriving_eq]
#[deriving(Eq)]
#[auto_encode]
#[auto_decode]
struct WorkKey {

@ -33,13 +33,13 @@ macro_rules! interner_key (
// table and a SyntaxContext to track renaming and
// macro expansion per Flatt et al., "Macros
// That Work Together"
#[deriving_eq]
#[deriving(Eq)]
pub struct ident { repr: Name }
// a SyntaxContext represents a chain of macro-expandings
// and renamings. Each macro expansion corresponds to
// a fresh uint
#[deriving_eq]
#[deriving(Eq)]
pub enum SyntaxContext {
MT,
Mark (Mrk,~SyntaxContext),
@ -98,7 +98,7 @@ pub type fn_ident = Option<ident>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct Lifetime {
id: node_id,
span: span,
@ -111,7 +111,7 @@ pub struct Lifetime {
// of supporting information.
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct path {
span: span,
global: bool,
@ -126,7 +126,7 @@ pub type node_id = int;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct def_id {
crate: crate_num,
node: node_id,
@ -137,7 +137,7 @@ pub const crate_node_id: node_id = 0;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
// The AST represents all type param bounds as types.
// typeck::collect::compute_bounds matches these against
// the "special" built-in traits (see middle::lang_items) and
@ -149,7 +149,7 @@ pub enum TyParamBound {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct TyParam {
ident: ident,
id: node_id,
@ -158,7 +158,7 @@ pub struct TyParam {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct Generics {
lifetimes: OptVec<Lifetime>,
ty_params: OptVec<TyParam>
@ -178,7 +178,7 @@ pub impl Generics {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum def {
def_fn(def_id, purity),
def_static_method(/* method */ def_id,
@ -216,7 +216,7 @@ pub type crate = spanned<crate_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct crate_ {
module: _mod,
attrs: ~[attribute],
@ -227,7 +227,7 @@ pub type meta_item = spanned<meta_item_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum meta_item_ {
meta_word(@~str),
meta_list(@~str, ~[@meta_item]),
@ -238,7 +238,7 @@ pub type blk = spanned<blk_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct blk_ {
view_items: ~[@view_item],
stmts: ~[@stmt],
@ -249,7 +249,7 @@ pub struct blk_ {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct pat {
id: node_id,
node: pat_,
@ -258,7 +258,7 @@ pub struct pat {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct field_pat {
ident: ident,
pat: @pat,
@ -266,7 +266,7 @@ pub struct field_pat {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum binding_mode {
bind_by_copy,
bind_by_ref(mutability),
@ -289,7 +289,7 @@ impl to_bytes::IterBytes for binding_mode {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum pat_ {
pat_wild,
// A pat_ident may either be a new bound variable,
@ -316,7 +316,7 @@ pub enum pat_ {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum mutability { m_mutbl, m_imm, m_const, }
impl to_bytes::IterBytes for mutability {
@ -327,7 +327,7 @@ impl to_bytes::IterBytes for mutability {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum Abi {
RustAbi
}
@ -348,7 +348,7 @@ impl ToStr for Abi {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum Sigil {
BorrowedSigil,
OwnedSigil,
@ -373,7 +373,7 @@ impl ToStr for Sigil {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum vstore {
// FIXME (#3469): Change uint to @expr (actually only constant exprs)
vstore_fixed(Option<uint>), // [1,2,3,4]
@ -384,7 +384,7 @@ pub enum vstore {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum expr_vstore {
expr_vstore_fixed(Option<uint>), // [1,2,3,4]
expr_vstore_uniq, // ~[1,2,3,4]
@ -396,7 +396,7 @@ pub enum expr_vstore {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum binop {
add,
subtract,
@ -420,7 +420,7 @@ pub enum binop {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum unop {
box(mutability),
uniq(mutability),
@ -433,7 +433,7 @@ pub enum unop {
// using ty::resolved_T(...).
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum inferable<T> {
expl(T),
infer(node_id)
@ -454,7 +454,7 @@ impl<T:to_bytes::IterBytes> to_bytes::IterBytes for inferable<T> {
// "resolved" mode: the real modes.
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum rmode { by_ref, by_copy }
impl to_bytes::IterBytes for rmode {
@ -470,7 +470,7 @@ pub type stmt = spanned<stmt_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum stmt_ {
stmt_decl(@decl, node_id),
@ -488,7 +488,7 @@ pub enum stmt_ {
// a refinement on pat.
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct local_ {
is_mutbl: bool,
ty: @Ty,
@ -503,12 +503,12 @@ pub type decl = spanned<decl_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum decl_ { decl_local(~[@local]), decl_item(@item), }
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct arm {
pats: ~[@pat],
guard: Option<@expr>,
@ -517,7 +517,7 @@ pub struct arm {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct field_ {
mutbl: mutability,
ident: ident,
@ -528,12 +528,12 @@ pub type field = spanned<field_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum blk_check_mode { default_blk, unsafe_blk, }
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct expr {
id: node_id,
// Extra node ID is only used for index, assign_op, unary, binary, method
@ -545,13 +545,13 @@ pub struct expr {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum log_level { error, debug, log_other }
// 0 = error, 1 = debug, 2 = log_other
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum CallSugar {
NoSugar,
DoSugar,
@ -560,7 +560,7 @@ pub enum CallSugar {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum expr_ {
expr_vstore(@expr, expr_vstore),
expr_vec(~[@expr], mutability),
@ -634,7 +634,7 @@ pub enum expr_ {
//
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
#[doc="For macro invocations; parsing is delegated to the macro"]
pub enum token_tree {
// a single token
@ -709,7 +709,7 @@ pub type matcher = spanned<matcher_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum matcher_ {
// match one token
match_tok(::parse::token::Token),
@ -724,7 +724,7 @@ pub type mac = spanned<mac_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum mac_ {
mac_invoc_tt(@path,~[token_tree]), // new macro-invocation
}
@ -733,7 +733,7 @@ pub type lit = spanned<lit_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum lit_ {
lit_str(@~str),
lit_int(i64, int_ty),
@ -749,7 +749,7 @@ pub enum lit_ {
// type structure in middle/ty.rs as well.
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct mt {
ty: @Ty,
mutbl: mutability,
@ -757,7 +757,7 @@ pub struct mt {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct ty_field_ {
ident: ident,
mt: mt,
@ -767,7 +767,7 @@ pub type ty_field = spanned<ty_field_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct ty_method {
ident: ident,
attrs: ~[attribute],
@ -781,7 +781,7 @@ pub struct ty_method {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
// A trait method is either required (meaning it doesn't have an
// implementation, just a signature) or provided (meaning it has a default
// implementation).
@ -792,7 +792,7 @@ pub enum trait_method {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum int_ty { ty_i, ty_char, ty_i8, ty_i16, ty_i32, ty_i64, }
impl ToStr for int_ty {
@ -809,7 +809,7 @@ impl to_bytes::IterBytes for int_ty {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum uint_ty { ty_u, ty_u8, ty_u16, ty_u32, ty_u64, }
impl ToStr for uint_ty {
@ -826,7 +826,7 @@ impl to_bytes::IterBytes for uint_ty {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum float_ty { ty_f, ty_f32, ty_f64, }
impl ToStr for float_ty {
@ -844,7 +844,7 @@ impl to_bytes::IterBytes for float_ty {
// NB Eq method appears below.
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct Ty {
id: node_id,
node: ty_,
@ -854,7 +854,7 @@ pub struct Ty {
// Not represented directly in the AST, referred to by name through a ty_path.
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum prim_ty {
ty_int(int_ty),
ty_uint(uint_ty),
@ -865,7 +865,7 @@ pub enum prim_ty {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum Onceness {
Once,
Many
@ -888,7 +888,7 @@ impl to_bytes::IterBytes for Onceness {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct TyClosure {
sigil: Sigil,
region: Option<@Lifetime>,
@ -899,7 +899,7 @@ pub struct TyClosure {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct TyBareFn {
purity: purity,
abi: Abi,
@ -908,7 +908,7 @@ pub struct TyBareFn {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum ty_ {
ty_nil,
ty_bot, /* bottom type */
@ -937,7 +937,7 @@ impl to_bytes::IterBytes for Ty {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct arg {
mode: mode,
is_mutbl: bool,
@ -948,7 +948,7 @@ pub struct arg {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct fn_decl {
inputs: ~[arg],
output: @Ty,
@ -957,7 +957,7 @@ pub struct fn_decl {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum purity {
pure_fn, // declared with "pure fn"
unsafe_fn, // declared with "unsafe fn"
@ -984,7 +984,7 @@ impl to_bytes::IterBytes for purity {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum ret_style {
noreturn, // functions with return type _|_ that always
// raise an error or exit (i.e. never return to the caller)
@ -999,7 +999,7 @@ impl to_bytes::IterBytes for ret_style {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum self_ty_ {
sty_static, // no self
sty_by_ref, // ``
@ -1022,7 +1022,7 @@ pub type self_ty = spanned<self_ty_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct method {
ident: ident,
attrs: ~[attribute],
@ -1039,7 +1039,7 @@ pub struct method {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct _mod {
view_items: ~[@view_item],
items: ~[@item],
@ -1047,7 +1047,7 @@ pub struct _mod {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum foreign_abi {
foreign_abi_rust_intrinsic,
foreign_abi_cdecl,
@ -1057,12 +1057,12 @@ pub enum foreign_abi {
// Foreign mods can be named or anonymous
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum foreign_mod_sort { named, anonymous }
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct foreign_mod {
sort: foreign_mod_sort,
abi: ident,
@ -1072,7 +1072,7 @@ pub struct foreign_mod {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct variant_arg {
ty: @Ty,
id: node_id,
@ -1080,7 +1080,7 @@ pub struct variant_arg {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum variant_kind {
tuple_variant_kind(~[variant_arg]),
struct_variant_kind(@struct_def),
@ -1089,7 +1089,7 @@ pub enum variant_kind {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct enum_def {
variants: ~[variant],
common: Option<@struct_def>,
@ -1097,7 +1097,7 @@ pub struct enum_def {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct variant_ {
name: ident,
attrs: ~[attribute],
@ -1111,7 +1111,7 @@ pub type variant = spanned<variant_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct path_list_ident_ {
name: ident,
id: node_id,
@ -1121,14 +1121,14 @@ pub type path_list_ident = spanned<path_list_ident_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum namespace { module_ns, type_value_ns }
pub type view_path = spanned<view_path_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum view_path_ {
// quux = foo::bar::baz
@ -1147,7 +1147,7 @@ pub enum view_path_ {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct view_item {
node: view_item_,
attrs: ~[attribute],
@ -1157,7 +1157,7 @@ pub struct view_item {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum view_item_ {
view_item_extern_mod(ident, ~[@meta_item], node_id),
view_item_use(~[@view_path]),
@ -1171,13 +1171,13 @@ pub type attribute = spanned<attribute_>;
// distinguished for pretty-printing.
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum attr_style { attr_outer, attr_inner, }
// doc-comments are promoted to attributes that have is_sugared_doc = true
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct attribute_ {
style: attr_style,
value: @meta_item,
@ -1193,7 +1193,7 @@ pub struct attribute_ {
*/
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct trait_ref {
path: @path,
ref_id: node_id,
@ -1201,12 +1201,12 @@ pub struct trait_ref {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum visibility { public, private, inherited }
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct struct_field_ {
kind: struct_field_kind,
id: node_id,
@ -1217,7 +1217,7 @@ pub type struct_field = spanned<struct_field_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum struct_field_kind {
named_field(ident, struct_mutability, visibility),
unnamed_field // element of a tuple-like struct
@ -1225,7 +1225,7 @@ pub enum struct_field_kind {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct struct_def {
fields: ~[@struct_field], /* fields */
/* (not including ctor or dtor) */
@ -1242,7 +1242,7 @@ pub struct struct_def {
*/
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct item {
ident: ident,
attrs: ~[attribute],
@ -1254,7 +1254,7 @@ pub struct item {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum item_ {
item_const(@Ty, @expr),
item_fn(fn_decl, purity, Generics, blk),
@ -1274,7 +1274,7 @@ pub enum item_ {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum struct_mutability { struct_mutable, struct_immutable }
impl to_bytes::IterBytes for struct_mutability {
@ -1287,7 +1287,7 @@ pub type struct_dtor = spanned<struct_dtor_>;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct struct_dtor_ {
id: node_id,
attrs: ~[attribute],
@ -1297,7 +1297,7 @@ pub struct struct_dtor_ {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct foreign_item {
ident: ident,
attrs: ~[attribute],
@ -1309,7 +1309,7 @@ pub struct foreign_item {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum foreign_item_ {
foreign_item_fn(fn_decl, purity, Generics),
foreign_item_const(@Ty)
@ -1320,7 +1320,7 @@ pub enum foreign_item_ {
// that we trans.
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum inlined_item {
ii_item(@item),
ii_method(def_id /* impl id */, @method),

@ -582,7 +582,7 @@ pub fn variant_visibility_to_privacy(visibility: visibility,
}
}
#[deriving_eq]
#[deriving(Eq)]
pub enum Privacy {
Private,
Public

@ -128,7 +128,7 @@ pub struct span {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub struct spanned<T> { node: T, span: span }
impl cmp::Eq for span {

@ -160,7 +160,7 @@ pub fn mk_handler(emitter: Option<Emitter>) -> @handler {
@mut HandlerT { err_count: 0, emit: emit } as @handler
}
#[deriving_eq]
#[deriving(Eq)]
pub enum level {
fatal,
error,

@ -1204,7 +1204,7 @@ mod test {
use std::serialize::Encoder;
// just adding the ones I want to test, for now:
#[deriving_eq]
#[deriving(Eq)]
pub enum call {
CallToEmitEnum(~str),
CallToEmitEnumVariant(~str, uint, uint),

@ -153,13 +153,13 @@ pub fn syntax_expander_table() -> SyntaxEnv {
ext::deriving::expand_meta_deriving)));
syntax_expanders.insert(@~"deriving_eq",
@SE(ItemDecorator(
ext::deriving::eq::expand_deriving_eq)));
ext::deriving::eq::expand_deriving_obsolete)));
syntax_expanders.insert(@~"deriving_iter_bytes",
@SE(ItemDecorator(
ext::deriving::iter_bytes::expand_deriving_iter_bytes)));
ext::deriving::iter_bytes::expand_deriving_obsolete)));
syntax_expanders.insert(@~"deriving_clone",
@SE(ItemDecorator(
ext::deriving::clone::expand_deriving_clone)));
ext::deriving::clone::expand_deriving_obsolete)));
// Quasi-quoting expanders
syntax_expanders.insert(@~"quote_tokens",

@ -39,6 +39,15 @@ pub fn expand_deriving_clone(cx: @ext_ctxt,
expand_deriving_clone_enum_def)
}
pub fn expand_deriving_obsolete(cx: @ext_ctxt,
span: span,
_mitem: @meta_item,
in_items: ~[@item])
-> ~[@item] {
cx.span_err(span, ~"`#[deriving_clone]` is obsolete; use `#[deriving(Clone)]` instead");
in_items
}
fn create_derived_clone_impl(cx: @ext_ctxt,
span: span,
type_ident: ident,

@ -53,6 +53,15 @@ pub fn expand_deriving_eq(cx: @ext_ctxt,
expand_deriving_eq_enum_def)
}
pub fn expand_deriving_obsolete(cx: @ext_ctxt,
span: span,
_mitem: @meta_item,
in_items: ~[@item])
-> ~[@item] {
cx.span_err(span, ~"`#[deriving_eq]` is obsolete; use `#[deriving(Eq)]` instead");
in_items
}
/// Creates a method from the given expression, the signature of which
/// conforms to the `eq` or `ne` method.
fn create_eq_method(cx: @ext_ctxt,

@ -39,6 +39,16 @@ pub fn expand_deriving_iter_bytes(cx: @ext_ctxt,
expand_deriving_iter_bytes_enum_def)
}
pub fn expand_deriving_obsolete(cx: @ext_ctxt,
span: span,
_mitem: @meta_item,
in_items: ~[@item])
-> ~[@item] {
cx.span_err(span, ~"`#[deriving_iter_bytes]` is obsolete; use `#[deriving(IterBytes)]` \
instead");
in_items
}
fn create_derived_iter_bytes_impl(cx: @ext_ctxt,
span: span,
type_ident: ident,

@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
/// The compiler code necessary to implement the #[deriving_eq] and
/// #[deriving_iter_bytes] extensions.
/// The compiler code necessary to implement the #[deriving(Eq)] and
/// #[deriving(IterBytes)] extensions.
use core::prelude::*;

@ -17,7 +17,7 @@ use ext::pipes::ast_builder::{append_types, ext_ctxt_ast_builder, path};
use core::to_str::ToStr;
#[deriving_eq]
#[deriving(Eq)]
pub enum direction { send, recv }
impl ToStr for direction {

@ -106,7 +106,7 @@ impl<T:Copy> OptVec<T> {
impl<A:Eq> Eq for OptVec<A> {
pure fn eq(&self, other: &OptVec<A>) -> bool {
// Note: cannot use #[deriving_eq] here because
// Note: cannot use #[deriving(Eq)] here because
// (Empty, Vec(~[])) ought to be equal.
match (self, other) {
(&Empty, &Empty) => true,

@ -37,7 +37,7 @@ pub trait reader {
fn dup(@mut self) -> @reader;
}
#[deriving_eq]
#[deriving(Eq)]
pub struct TokenAndSpan {tok: token::Token, sp: span}
pub struct StringReader {

@ -30,7 +30,7 @@ use core::str;
use core::to_bytes;
/// The specific types of unsupported syntax
#[deriving_eq]
#[deriving(Eq)]
pub enum ObsoleteSyntax {
ObsoleteLowerCaseKindBounds,
ObsoleteLet,

@ -93,7 +93,7 @@ use core::either;
use core::vec;
use std::oldmap::HashMap;
#[deriving_eq]
#[deriving(Eq)]
enum restriction {
UNRESTRICTED,
RESTRICT_STMT_EXPR,

@ -24,7 +24,7 @@ use std::oldmap::HashMap;
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum binop {
PLUS,
MINUS,
@ -40,7 +40,7 @@ pub enum binop {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
pub enum Token {
/* Expression-operator symbols. */
EQ,
@ -103,7 +103,7 @@ pub enum Token {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
/// For interpolation during macro expansion.
pub enum nonterminal {
nt_item(@ast::item),

@ -66,7 +66,7 @@ use core::vec;
* line (which it can't) and so naturally place the content on its own line to
* avoid combining it with other lines and making matters even worse.
*/
#[deriving_eq]
#[deriving(Eq)]
pub enum breaks { consistent, inconsistent, }
pub struct break_t {

@ -0,0 +1,17 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_clone] //~ ERROR `#[deriving_clone]` is obsolete; use `#[deriving(Clone)]` instead
#[deriving_eq] //~ ERROR `#[deriving_eq]` is obsolete; use `#[deriving(Eq)]` instead
#[deriving_iter_bytes]
//~^ ERROR `#[deriving_iter_bytes]` is obsolete; use `#[deriving(IterBytes)]` instead
struct Foo;
pub fn main() { }

@ -1,6 +1,6 @@
// error-pattern:expected: 15, given: 14
#[deriving_eq]
#[deriving(Eq)]
struct Point { x : int }
fn main() {

@ -1,4 +1,4 @@
#[deriving_eq]
#[deriving(Eq)]
struct Point { x : int }
fn main() {

@ -121,7 +121,7 @@ impl cmp::Eq for CLike {
#[auto_encode]
#[auto_decode]
#[deriving_eq]
#[deriving(Eq)]
struct Spanned<T> {
lo: uint,
hi: uint,

@ -88,7 +88,7 @@ mod test {
}
}
#[deriving_eq]
#[deriving(Eq)]
struct p {
x: int,
y: int,

@ -1,4 +1,4 @@
#[deriving_clone]
#[deriving(Clone)]
enum E {
A,
B(()),

@ -1,4 +1,4 @@
#[deriving_clone]
#[deriving(Clone)]
enum E<T,U> {
A(T),
B(T,U),

@ -1,4 +1,4 @@
#[deriving_clone]
#[deriving(Clone)]
struct S<T> {
foo: (),
bar: (),

@ -1,4 +1,4 @@
#[deriving_clone]
#[deriving(Clone)]
struct S<T>(T, ());
fn main() {}

@ -1,4 +1,4 @@
#[deriving_clone]
#[deriving(Clone)]
struct S {
_int: int,
_i8: i8,

@ -1,4 +1,4 @@
#[deriving_clone]
#[deriving(Clone)]
struct S((), ());
fn main() {}

@ -1,6 +1,6 @@
type task_id = int;
#[deriving_eq]
#[deriving(Eq)]
pub enum Task {
TaskHandle(task_id)
}

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_eq]
#[deriving(Eq)]
enum Foo {
Bar,
Baz,

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_eq]
#[deriving(Eq)]
enum Foo {
Bar(int, int),
Baz(float, float)

@ -10,13 +10,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_iter_bytes]
#[deriving(IterBytes)]
enum Foo {
Bar(int, char),
Baz(char, int)
}
#[deriving_iter_bytes]
#[deriving(IterBytes)]
enum A {
B,
C,

@ -10,7 +10,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_iter_bytes]
#[deriving(IterBytes)]
struct Foo {
x: int,
y: int,

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_eq]
#[deriving(Eq)]
struct Foo;
pub fn main() {

@ -1,4 +1,4 @@
#[deriving_eq]
#[deriving(Eq)]
enum S {
X { x: int, y: int },
Y

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_eq]
#[deriving(Eq)]
struct Foo(int, int, ~str);
pub fn main() {

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_eq]
#[deriving(Eq)]
struct Foo {
x: int,
y: int,

@ -10,8 +10,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_eq]
#[deriving_iter_bytes]
#[deriving(Eq)]
#[deriving(IterBytes)]
struct Foo<T> {
x: int,
y: T,

@ -12,7 +12,7 @@
// xfail-test --- broken on 32-bit ABIs! (#5347)
#[deriving_eq]
#[deriving(Eq)]
struct TwoU64s {
one: u64, two: u64
}

@ -13,7 +13,7 @@
// xfail-test --- broken on 32-bit ABIs! (#5347)
#[deriving_eq]
#[deriving(Eq)]
struct TwoU64s {
one: u64, two: u64
}

@ -20,7 +20,7 @@ pub mod pipes {
payload: Option<T>
}
#[deriving_eq]
#[deriving(Eq)]
pub enum state {
empty,
full,

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving_eq]
#[deriving(Eq)]
struct Bike {
name: ~str,
}

@ -9,7 +9,7 @@
// except according to those terms.
#[deriving_eq]
#[deriving(Eq)]
enum t { a, b(~str), }
fn make(i: int) -> t {