提交 4055fe83 编写于 作者: A Andrew Paseltiner

std: replace uses of old deriving attribute with new one

上级 98e8fe12
......@@ -253,15 +253,15 @@ fn test_parameterized<T:Copy + Eq + Durable>(a: T, b: T, c: T, d: T) {
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::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::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;
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 fn decode_form_urlencoded(s: &[u8]) -> LinearMap<~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::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 @@
*
*/
#[deriving_eq]
#[deriving(Eq)]
#[auto_encode]
#[auto_decode]
struct WorkKey {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册