diff --git a/src/compiletest/common.rs b/src/compiletest/common.rs index 62b757529dc9f..202a87fcdc9e7 100644 --- a/src/compiletest/common.rs +++ b/src/compiletest/common.rs @@ -13,7 +13,7 @@ use std::fmt; use std::str::FromStr; use regex::Regex; -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub enum Mode { CompileFail, RunFail, @@ -59,7 +59,7 @@ impl fmt::Show for Mode { } } -#[deriving(Clone)] +#[derive(Clone)] pub struct Config { // The library paths required for running the compiler pub compile_lib_path: String, diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 16c6f7250306d..f330bb3143eab 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -30,7 +30,7 @@ pub struct ExpectedError { pub static EXPECTED_PATTERN : &'static str = r"//~(?P\|)?(?P\^*)\s*(?P\S*)\s*(?P.*)"; -#[deriving(PartialEq, Show)] +#[derive(PartialEq, Show)] enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) } // Load any test directives embedded in the file diff --git a/src/doc/guide-error-handling.md b/src/doc/guide-error-handling.md index d833827981e27..5cd4dc3e23e30 100644 --- a/src/doc/guide-error-handling.md +++ b/src/doc/guide-error-handling.md @@ -147,10 +147,10 @@ for all but the most trivial of situations. Here's an example of using `Result`: ```rust -#[deriving(Show)] +#[derive(Show)] enum Version { Version1, Version2 } -#[deriving(Show)] +#[derive(Show)] enum ParseError { InvalidHeaderLength, InvalidVersion } fn parse_version(header: &[u8]) -> Result { diff --git a/src/doc/guide-pointers.md b/src/doc/guide-pointers.md index 678e817e2ebbe..6a215060daddd 100644 --- a/src/doc/guide-pointers.md +++ b/src/doc/guide-pointers.md @@ -612,7 +612,7 @@ Sometimes, you need a recursive data structure. The simplest is known as a ```{rust} -#[deriving(Show)] +#[derive(Show)] enum List { Cons(T, Box>), Nil, diff --git a/src/doc/reference.md b/src/doc/reference.md index f3ad19bbd2a6c..1016564afc0a9 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2411,7 +2411,7 @@ for data structures. For example, the following will create an `impl` for the the `PartialEq` or `Clone` constraints for the appropriate `impl`: ``` -#[deriving(PartialEq, Clone)] +#[derive(PartialEq, Clone)] struct Foo { a: int, b: T diff --git a/src/doc/rustdoc.md b/src/doc/rustdoc.md index 054552559dbec..aba13d3198906 100644 --- a/src/doc/rustdoc.md +++ b/src/doc/rustdoc.md @@ -198,7 +198,7 @@ Rustdoc also supplies some extra sugar for helping with some tedious documentation examples. If a line is prefixed with `# `, then the line will not show up in the HTML documentation, but it will be used when testing the code block (NB. the space after the `#` is required, so -that one can still write things like `#[deriving(Eq)]`). +that one can still write things like `#[derive(Eq)]`). ~~~md ``` diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 820a3838978c0..2717b80b3577e 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -798,6 +798,6 @@ mod tests { } // Make sure deriving works with Arc - #[deriving(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)] + #[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)] struct Foo { inner: Arc } } diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index b0fa5434a1474..423c16bfee8e8 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -46,7 +46,7 @@ use std::rt::heap::{allocate, deallocate}; // The way arena uses arrays is really deeply awful. The arrays are // allocated, and have capacities reserved, but the fill for the array // will always stay at 0. -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] struct Chunk { data: Rc>>, fill: Cell, diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs index 64e10e69a2ef3..0117bf72608c9 100644 --- a/src/libcollections/binary_heap.rs +++ b/src/libcollections/binary_heap.rs @@ -29,7 +29,7 @@ //! use std::collections::BinaryHeap; //! use std::uint; //! -//! #[deriving(Copy, Eq, PartialEq)] +//! #[derive(Copy, Eq, PartialEq)] //! struct State { //! cost: uint, //! position: uint, @@ -160,7 +160,7 @@ use vec::{mod, Vec}; /// A priority queue implemented with a binary heap. /// /// This will be a max-heap. -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct BinaryHeap { data: Vec, @@ -563,7 +563,7 @@ pub struct Iter <'a, T: 'a> { iter: slice::Iter<'a, T>, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, T> Clone for Iter<'a, T> { fn clone(&self) -> Iter<'a, T> { Iter { iter: self.iter.clone() } diff --git a/src/libcollections/bit.rs b/src/libcollections/bit.rs index d8dfc02c97a46..d2ea2f05430d3 100644 --- a/src/libcollections/bit.rs +++ b/src/libcollections/bit.rs @@ -1020,7 +1020,7 @@ impl cmp::Eq for Bitv {} /// An iterator for `Bitv`. #[stable] -#[deriving(Clone)] +#[derive(Clone)] pub struct Iter<'a> { bitv: &'a Bitv, next_idx: uint, @@ -1117,7 +1117,7 @@ impl<'a> RandomAccessIterator for Iter<'a> { /// let bv: Bitv = s.into_bitv(); /// assert!(bv[3]); /// ``` -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct BitvSet { bitv: Bitv, @@ -1762,7 +1762,7 @@ impl hash::Hash for BitvSet { } /// An iterator for `BitvSet`. -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct SetIter<'a> { set: &'a BitvSet, @@ -1770,7 +1770,7 @@ pub struct SetIter<'a> { } /// An iterator combining two `BitvSet` iterators. -#[deriving(Clone)] +#[derive(Clone)] struct TwoBitPositions<'a> { set: &'a BitvSet, other: &'a BitvSet, diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index 87b40aa1ceeaf..84f3c62a99f1f 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -79,7 +79,7 @@ use self::Continuation::{Continue, Finished}; /// force this degenerate behaviour to occur on every operation. While the total amount of work /// done on each operation isn't *catastrophic*, and *is* still bounded by O(B logBn), /// it is certainly much slower when it does. -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct BTreeMap { root: Node, diff --git a/src/libcollections/btree/node.rs b/src/libcollections/btree/node.rs index 3907f28092a37..95f2c5791b19f 100644 --- a/src/libcollections/btree/node.rs +++ b/src/libcollections/btree/node.rs @@ -490,7 +490,7 @@ impl Clone for Node { /// println!("Uninitialized memory: {}", handle.into_kv()); /// } /// ``` -#[deriving(Copy)] +#[derive(Copy)] pub struct Handle { node: NodeRef, index: uint diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs index f3f6727f1c06b..d62faa5c1e832 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -27,7 +27,7 @@ use core::fmt::Show; /// /// See BTreeMap's documentation for a detailed discussion of this collection's performance /// benefits and drawbacks. -#[deriving(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)] +#[derive(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)] #[stable] pub struct BTreeSet{ map: BTreeMap, diff --git a/src/libcollections/dlist.rs b/src/libcollections/dlist.rs index 8b7b7176b80e0..055a52ed77d92 100644 --- a/src/libcollections/dlist.rs +++ b/src/libcollections/dlist.rs @@ -83,7 +83,7 @@ pub struct IterMut<'a, T:'a> { } /// An iterator over mutable references to the items of a `DList`. -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct IntoIter { list: DList diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index b484fc41ff6e5..e9bea494198a8 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -19,7 +19,7 @@ use core::num::Int; // FIXME(contentions): implement union family of methods? (general design may be wrong here) -#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] /// A specialized set implementation to use enum types. pub struct EnumSet { // We must maintain the invariant that no bits are set @@ -213,7 +213,7 @@ pub struct Iter { bits: uint, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl Clone for Iter { fn clone(&self) -> Iter { Iter { @@ -275,7 +275,7 @@ mod test { use super::{EnumSet, CLike}; - #[deriving(Copy, PartialEq, Show)] + #[derive(Copy, PartialEq, Show)] #[repr(uint)] enum Foo { A, B, C @@ -479,7 +479,7 @@ mod test { #[should_fail] fn test_overflow() { #[allow(dead_code)] - #[deriving(Copy)] + #[derive(Copy)] #[repr(uint)] enum Bar { V00, V01, V02, V03, V04, V05, V06, V07, V08, V09, diff --git a/src/libcollections/ring_buf.rs b/src/libcollections/ring_buf.rs index 12148947a19a6..23a7a56c8f6a9 100644 --- a/src/libcollections/ring_buf.rs +++ b/src/libcollections/ring_buf.rs @@ -1137,7 +1137,7 @@ pub struct Iter<'a, T:'a> { head: uint } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, T> Clone for Iter<'a, T> { fn clone(&self) -> Iter<'a, T> { Iter { @@ -1638,21 +1638,21 @@ mod tests { }) } - #[deriving(Clone, PartialEq, Show)] + #[derive(Clone, PartialEq, Show)] enum Taggy { One(int), Two(int, int), Three(int, int, int), } - #[deriving(Clone, PartialEq, Show)] + #[derive(Clone, PartialEq, Show)] enum Taggypar { Onepar(int), Twopar(int, int), Threepar(int, int, int), } - #[deriving(Clone, PartialEq, Show)] + #[derive(Clone, PartialEq, Show)] struct RecCy { x: int, y: int, diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 61111d96bd064..f78d6fc90f481 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -1056,7 +1056,7 @@ impl> SliceConcatExt> for [V] { /// The last generated swap is always (0, 1), and it returns the /// sequence to its initial order. #[experimental] -#[deriving(Clone)] +#[derive(Clone)] pub struct ElementSwaps { sdir: Vec, /// If `true`, emit the last swap that returns the sequence to initial @@ -1103,11 +1103,11 @@ impl ToOwned> for [T] { // Iterators //////////////////////////////////////////////////////////////////////////////// -#[deriving(Copy, Clone)] +#[derive(Copy, Clone)] enum Direction { Pos, Neg } /// An `Index` and `Direction` together. -#[deriving(Copy, Clone)] +#[derive(Copy, Clone)] struct SizeDirection { size: uint, dir: Direction, @@ -2678,7 +2678,7 @@ mod tests { assert!(values == [2, 3, 5, 6, 7]); } - #[deriving(Clone, PartialEq)] + #[derive(Clone, PartialEq)] struct Foo; #[test] diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 129ba77d9f7a6..18149e5c5755b 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -165,7 +165,7 @@ fn canonical_sort(comb: &mut [(char, u8)]) { } } -#[deriving(Clone)] +#[derive(Clone)] enum DecompositionType { Canonical, Compatible @@ -173,7 +173,7 @@ enum DecompositionType { /// External iterator for a string's decomposition's characters. /// Use with the `std::iter` module. -#[deriving(Clone)] +#[derive(Clone)] pub struct Decompositions<'a> { kind: DecompositionType, iter: Chars<'a>, @@ -250,7 +250,7 @@ impl<'a> Iterator for Decompositions<'a> { } } -#[deriving(Clone)] +#[derive(Clone)] enum RecompositionState { Composing, Purging, @@ -259,7 +259,7 @@ enum RecompositionState { /// External iterator for a string's recomposition's characters. /// Use with the `std::iter` module. -#[deriving(Clone)] +#[derive(Clone)] pub struct Recompositions<'a> { iter: Decompositions<'a>, state: RecompositionState, @@ -352,7 +352,7 @@ impl<'a> Iterator for Recompositions<'a> { /// External iterator for a string's UTF16 codeunits. /// Use with the `std::iter` module. -#[deriving(Clone)] +#[derive(Clone)] pub struct Utf16Units<'a> { encoder: Utf16Encoder> } diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 37a6e690f5d30..78adf09b7ce10 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -32,7 +32,7 @@ use str::{mod, CharRange, FromStr, Utf8Error}; use vec::{DerefVec, Vec, as_vec}; /// A growable string stored as a UTF-8 encoded buffer. -#[deriving(Clone, PartialOrd, Eq, Ord)] +#[derive(Clone, PartialOrd, Eq, Ord)] #[stable] pub struct String { vec: Vec, diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index a1952352badfa..8c385ac71f6ee 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -795,7 +795,7 @@ impl Vec { /// let w = v.map_in_place(|i| i + 3); /// assert_eq!(w.as_slice(), [3, 4, 5].as_slice()); /// - /// #[deriving(PartialEq, Show)] + /// #[derive(PartialEq, Show)] /// struct Newtype(u8); /// let bytes = vec![0x11, 0x22]; /// let newtyped_bytes = bytes.map_in_place(|x| Newtype(x)); @@ -2241,7 +2241,7 @@ mod tests { #[test] fn test_map_in_place_zero_sized() { let v = vec![(), ()]; - #[deriving(PartialEq, Show)] + #[derive(PartialEq, Show)] struct ZeroSized; assert_eq!(v.map_in_place(|_| ZeroSized), [ZeroSized, ZeroSized]); } @@ -2251,11 +2251,11 @@ mod tests { use std::sync::atomic; use std::sync::atomic::AtomicUint; - #[deriving(Clone, PartialEq, Show)] + #[derive(Clone, PartialEq, Show)] struct Nothing; impl Drop for Nothing { fn drop(&mut self) { } } - #[deriving(Clone, PartialEq, Show)] + #[derive(Clone, PartialEq, Show)] struct ZeroSized; impl Drop for ZeroSized { fn drop(&mut self) { diff --git a/src/libcollections/vec_map.rs b/src/libcollections/vec_map.rs index 7c30912cf91ba..42495ceab5f07 100644 --- a/src/libcollections/vec_map.rs +++ b/src/libcollections/vec_map.rs @@ -644,7 +644,7 @@ pub struct Iter<'a, V:'a> { iter: slice::Iter<'a, Option> } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, V> Clone for Iter<'a, V> { fn clone(&self) -> Iter<'a, V> { Iter { @@ -676,7 +676,7 @@ pub struct Keys<'a, V: 'a> { iter: Map<(uint, &'a V), uint, Iter<'a, V>, fn((uint, &'a V)) -> uint> } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, V> Clone for Keys<'a, V> { fn clone(&self) -> Keys<'a, V> { Keys { @@ -691,7 +691,7 @@ pub struct Values<'a, V: 'a> { iter: Map<(uint, &'a V), &'a V, Iter<'a, V>, fn((uint, &'a V)) -> &'a V> } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, V> Clone for Values<'a, V> { fn clone(&self) -> Values<'a, V> { Values { diff --git a/src/libcore/atomic.rs b/src/libcore/atomic.rs index 6a40915f4dd82..0cf554d292c73 100644 --- a/src/libcore/atomic.rs +++ b/src/libcore/atomic.rs @@ -62,7 +62,7 @@ unsafe impl Sync for AtomicPtr {} /// Rust's memory orderings are [the same as /// C++'s](http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync). #[stable] -#[deriving(Copy)] +#[derive(Copy)] pub enum Ordering { /// No ordering constraints, only atomic operations. #[stable] diff --git a/src/libcore/char.rs b/src/libcore/char.rs index f0151dda8d71e..a96d81bb19f70 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -430,13 +430,13 @@ impl Char for char { /// An iterator over the characters that represent a `char`, as escaped by /// Rust's unicode escaping rules. -#[deriving(Clone)] +#[derive(Clone)] pub struct EscapeUnicode { c: char, state: EscapeUnicodeState } -#[deriving(Clone)] +#[derive(Clone)] enum EscapeUnicodeState { Backslash, Type, @@ -488,12 +488,12 @@ impl Iterator for EscapeUnicode { /// An iterator over the characters that represent a `char`, escaped /// for maximum portability. -#[deriving(Clone)] +#[derive(Clone)] pub struct EscapeDefault { state: EscapeDefaultState } -#[deriving(Clone)] +#[derive(Clone)] enum EscapeDefaultState { Backslash(char), Char(char), diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 367c794e84bb6..1c953e1112fac 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -104,7 +104,7 @@ pub trait Eq for Sized?: PartialEq { } /// An ordering is, e.g, a result of a comparison between two values. -#[deriving(Clone, Copy, PartialEq, Show)] +#[derive(Clone, Copy, PartialEq, Show)] #[stable] pub enum Ordering { /// An ordering where a compared value is less [than another]. diff --git a/src/libcore/default.rs b/src/libcore/default.rs index 0632ffd9c698c..8d4ecf7224339 100644 --- a/src/libcore/default.rs +++ b/src/libcore/default.rs @@ -26,7 +26,7 @@ //! ``` //! use std::default::Default; //! -//! #[deriving(Default)] +//! #[derive(Default)] //! struct SomeOptions { //! foo: int, //! bar: f32, @@ -54,7 +54,7 @@ //! fn default() -> Kind { Kind::A } //! } //! -//! #[deriving(Default)] +//! #[derive(Default)] //! struct SomeOptions { //! foo: int, //! bar: f32, @@ -71,7 +71,7 @@ //! //! ``` //! # use std::default::Default; -//! # #[deriving(Default)] +//! # #[derive(Default)] //! # struct SomeOptions { //! # foo: int, //! # bar: f32, @@ -86,12 +86,12 @@ /// A trait that types which have a useful default value should implement. /// /// A struct can derive default implementations of `Default` for basic types using -/// `#[deriving(Default)]`. +/// `#[derive(Default)]`. /// /// # Examples /// /// ``` -/// #[deriving(Default)] +/// #[derive(Default)] /// struct SomeOptions { /// foo: int, /// bar: f32, diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 87fcb12e29f9c..5478cf2f0dbec 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -44,7 +44,7 @@ pub type Result = result::Result<(), Error>; /// occurred. Any extra information must be arranged to be transmitted through /// some other means. #[experimental = "core and I/O reconciliation may alter this definition"] -#[deriving(Copy)] +#[derive(Copy)] pub struct Error; /// A collection of methods that are required to format a message into a stream. @@ -103,7 +103,7 @@ enum Void {} /// compile time it is ensured that the function and the value have the correct /// types, and then this struct is used to canonicalize arguments to one type. #[experimental = "implementation detail of the `format_args!` macro"] -#[deriving(Copy)] +#[derive(Copy)] pub struct Argument<'a> { value: &'a Void, formatter: fn(&Void, &mut Formatter) -> Result, @@ -180,7 +180,7 @@ impl<'a> Arguments<'a> { /// macro validates the format string at compile-time so usage of the `write` /// and `format` functions can be safely performed. #[stable] -#[deriving(Copy)] +#[derive(Copy)] pub struct Arguments<'a> { // Format string pieces to print. pieces: &'a [&'a str], diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs index 7de3e847dc683..102c79703cb6d 100644 --- a/src/libcore/fmt/num.rs +++ b/src/libcore/fmt/num.rs @@ -65,23 +65,23 @@ trait GenericRadix { } /// A binary (base 2) radix -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] struct Binary; /// An octal (base 8) radix -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] struct Octal; /// A decimal (base 10) radix -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] struct Decimal; /// A hexadecimal (base 16) radix, formatted with lower-case characters -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] struct LowerHex; /// A hexadecimal (base 16) radix, formatted with upper-case characters -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub struct UpperHex; macro_rules! radix { @@ -108,7 +108,7 @@ radix! { UpperHex, 16, "0x", x @ 0 ... 9 => b'0' + x, x @ 10 ... 15 => b'A' + (x - 10) } /// A radix with in the range of `2..36`. -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] #[unstable = "may be renamed or move to a different module"] pub struct Radix { base: u8, @@ -134,7 +134,7 @@ impl GenericRadix for Radix { /// A helper type for formatting radixes. #[unstable = "may be renamed or move to a different module"] -#[deriving(Copy)] +#[derive(Copy)] pub struct RadixFmt(T, R); /// Constructs a radix formatter in the range of `2..36`. diff --git a/src/libcore/fmt/rt.rs b/src/libcore/fmt/rt.rs index 35dd0390f3087..6dbda3d84459e 100644 --- a/src/libcore/fmt/rt.rs +++ b/src/libcore/fmt/rt.rs @@ -22,14 +22,14 @@ pub use self::Position::*; pub use self::Flag::*; #[doc(hidden)] -#[deriving(Copy)] +#[derive(Copy)] pub struct Argument<'a> { pub position: Position, pub format: FormatSpec, } #[doc(hidden)] -#[deriving(Copy)] +#[derive(Copy)] pub struct FormatSpec { pub fill: char, pub align: Alignment, @@ -39,7 +39,7 @@ pub struct FormatSpec { } /// Possible alignments that can be requested as part of a formatting directive. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Alignment { /// Indication that contents should be left-aligned. AlignLeft, @@ -52,13 +52,13 @@ pub enum Alignment { } #[doc(hidden)] -#[deriving(Copy)] +#[derive(Copy)] pub enum Count { CountIs(uint), CountIsParam(uint), CountIsNextParam, CountImplied, } #[doc(hidden)] -#[deriving(Copy)] +#[derive(Copy)] pub enum Position { ArgumentNext, ArgumentIs(uint) } @@ -68,7 +68,7 @@ pub enum Position { /// These flags are discovered through the `flags` field of the `Formatter` /// structure. The flag in that structure is a union of these flags into a /// `uint` where each flag's discriminant is the corresponding bit. -#[deriving(Copy)] +#[derive(Copy)] pub enum Flag { /// A flag which enables number formatting to always print the sign of a /// number. diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs index d4d241752f20b..b0a5ec9fe12ed 100644 --- a/src/libcore/hash/mod.rs +++ b/src/libcore/hash/mod.rs @@ -11,7 +11,7 @@ //! Generic hashing support. //! //! This module provides a generic way to compute the hash of a value. The -//! simplest way to make a type hashable is to use `#[deriving(Hash)]`: +//! simplest way to make a type hashable is to use `#[derive(Hash)]`: //! //! # Examples //! @@ -19,7 +19,7 @@ //! use std::hash; //! use std::hash::Hash; //! -//! #[deriving(Hash)] +//! #[derive(Hash)] //! struct Person { //! id: uint, //! name: String, diff --git a/src/libcore/hash/sip.rs b/src/libcore/hash/sip.rs index 51c0827186d51..ace3b66c9b05f 100644 --- a/src/libcore/hash/sip.rs +++ b/src/libcore/hash/sip.rs @@ -30,7 +30,7 @@ use default::Default; use super::{Hash, Hasher, Writer}; /// `SipState` computes a SipHash 2-4 hash over a stream of bytes. -#[deriving(Copy)] +#[derive(Copy)] pub struct SipState { k0: u64, k1: u64, @@ -213,7 +213,7 @@ impl Default for SipState { } /// `SipHasher` computes the SipHash algorithm from a stream of bytes. -#[deriving(Clone)] +#[derive(Clone)] #[allow(missing_copy_implementations)] pub struct SipHasher { k0: u64, diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 950c47c636987..084cb7d0b2792 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -45,7 +45,7 @@ pub type GlueFn = extern "Rust" fn(*const i8); #[lang="ty_desc"] -#[deriving(Copy)] +#[derive(Copy)] pub struct TyDesc { // sizeof(T) pub size: uint, @@ -543,7 +543,7 @@ extern "rust-intrinsic" { /// `TypeId` represents a globally unique identifier for a type #[lang="type_id"] // This needs to be kept in lockstep with the code in trans/intrinsic.rs and // middle/lang_items.rs -#[deriving(Clone, Copy, PartialEq, Eq, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Show)] pub struct TypeId { t: u64, } diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 7c53503b1ceb7..4cb59756c0b70 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -857,7 +857,7 @@ impl ExactSizeIterator<(A, B)> for Zip where T: ExactSizeIterator, U: ExactSizeIterator {} /// An double-ended iterator with the direction inverted -#[deriving(Clone)] +#[derive(Clone)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[stable] pub struct Rev { @@ -1122,7 +1122,7 @@ impl> IteratorOrdExt for T { } /// `MinMaxResult` is an enum returned by `min_max`. See `IteratorOrdExt::min_max` for more detail. -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] #[unstable = "waiting on namespaced enum conventions"] pub enum MinMaxResult { /// Empty iterator @@ -1232,7 +1232,7 @@ impl CloneIteratorExt for I where I: Iterator + Clone { } /// An iterator that repeats endlessly -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[stable] pub struct Cycle { @@ -1286,7 +1286,7 @@ impl> RandomAccessIterator for Cycle } /// An iterator that strings two iterators together -#[deriving(Clone)] +#[derive(Clone)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[stable] pub struct Chain { @@ -1360,7 +1360,7 @@ for Chain { } /// An iterator that iterates two other iterators simultaneously -#[deriving(Clone)] +#[derive(Clone)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[stable] pub struct Zip { @@ -1450,7 +1450,7 @@ pub struct Map, F: FnMut(A) -> B> { f: F, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl Clone for Map where I: Clone + Iterator, @@ -1525,7 +1525,7 @@ pub struct Filter where I: Iterator, P: FnMut(&A) -> bool { predicate: P, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl Clone for Filter where I: Clone + Iterator, @@ -1584,7 +1584,7 @@ pub struct FilterMap where I: Iterator, F: FnMut(A) -> Option f: F, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl Clone for FilterMap where I: Clone + Iterator, @@ -1639,7 +1639,7 @@ impl DoubleEndedIterator for FilterMap where } /// An iterator that yields the current count and the element during iteration -#[deriving(Clone)] +#[derive(Clone)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[stable] pub struct Enumerate { @@ -1700,7 +1700,7 @@ impl> RandomAccessIterator<(uint, A)> for Enumerat /// An iterator with a `peek()` that returns an optional reference to the next element. #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[stable] -#[deriving(Copy)] +#[derive(Copy)] pub struct Peekable { iter: T, peeked: Option, @@ -1760,7 +1760,7 @@ pub struct SkipWhile where I: Iterator, P: FnMut(&A) -> bool { predicate: P, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl Clone for SkipWhile where I: Clone + Iterator, @@ -1804,7 +1804,7 @@ pub struct TakeWhile where I: Iterator, P: FnMut(&A) -> bool { predicate: P, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl Clone for TakeWhile where I: Clone + Iterator, @@ -1848,7 +1848,7 @@ impl Iterator for TakeWhile where I: Iterator, P: FnMut( } /// An iterator that skips over `n` elements of `iter`. -#[deriving(Clone)] +#[derive(Clone)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[stable] pub struct Skip { @@ -1916,7 +1916,7 @@ impl> RandomAccessIterator for Skip { } /// An iterator that only iterates over the first `n` iterations of `iter`. -#[deriving(Clone)] +#[derive(Clone)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[stable] pub struct Take { @@ -1980,7 +1980,7 @@ pub struct Scan where I: Iterator, F: FnMut(&mut St, A) -> Op pub state: St, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl Clone for Scan where I: Clone + Iterator, @@ -2025,7 +2025,7 @@ pub struct FlatMap where I: Iterator, U: Iterator, F: FnMut backiter: Option, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl Clone for FlatMap where I: Clone + Iterator, @@ -2100,7 +2100,7 @@ impl DoubleEndedIterator for FlatMap where /// An iterator that yields `None` forever after the underlying iterator /// yields `None` once. -#[deriving(Clone)] +#[derive(Clone)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[stable] pub struct Fuse { @@ -2186,7 +2186,7 @@ pub struct Inspect where I: Iterator, F: FnMut(&A) { f: F, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl Clone for Inspect where I: Clone + Iterator, @@ -2294,7 +2294,7 @@ pub struct Unfold where F: FnMut(&mut St) -> Option { pub state: St, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl Clone for Unfold where F: Clone + FnMut(&mut St) -> Option, @@ -2337,7 +2337,7 @@ impl Iterator for Unfold where F: FnMut(&mut St) -> Optio /// An infinite iterator starting at `start` and advancing by `step` with each /// iteration -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] #[unstable = "may be renamed"] pub struct Counter { /// The current state the counter is at (next value to be yielded) @@ -2369,7 +2369,7 @@ impl + Clone> Iterator for Counter { } /// An iterator over the range [start, stop) -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] #[unstable = "may be refactored due to numerics reform or ops reform"] pub struct Range { state: A, @@ -2462,7 +2462,7 @@ impl DoubleEndedIterator for Range { } /// An iterator over the range [start, stop] -#[deriving(Clone)] +#[derive(Clone)] #[unstable = "may be refactored due to numerics reform or ops reform"] pub struct RangeInclusive { range: Range, @@ -2530,7 +2530,7 @@ impl DoubleEndedIterator for RangeInclusive { } /// An iterator over the range [start, stop) by `step`. It handles overflow by stopping. -#[deriving(Clone)] +#[derive(Clone)] #[unstable = "may be refactored due to numerics reform or ops reform"] pub struct RangeStep { state: A, @@ -2565,7 +2565,7 @@ impl Iterator for RangeStep { } /// An iterator over the range [start, stop] by `step`. It handles overflow by stopping. -#[deriving(Clone)] +#[derive(Clone)] #[unstable = "may be refactored due to numerics reform or ops reform"] pub struct RangeStepInclusive { state: A, @@ -2666,7 +2666,7 @@ step_impl_no_between!(u64 i64); /// An iterator that repeats an element endlessly -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct Repeat { element: A diff --git a/src/libcore/kinds.rs b/src/libcore/kinds.rs index fb030ea45f399..e50aaef5f09f3 100644 --- a/src/libcore/kinds.rs +++ b/src/libcore/kinds.rs @@ -132,7 +132,7 @@ pub mod marker { /// (for example, `S<&'static int>` is a subtype of `S<&'a int>` /// for some lifetime `'a`, but not the other way around). #[lang="covariant_type"] - #[deriving(PartialEq, Eq, PartialOrd, Ord)] + #[derive(PartialEq, Eq, PartialOrd, Ord)] pub struct CovariantType; impl Copy for CovariantType {} @@ -180,7 +180,7 @@ pub mod marker { /// function requires arguments of type `T`, it must also accept /// arguments of type `U`, hence such a conversion is safe. #[lang="contravariant_type"] - #[deriving(PartialEq, Eq, PartialOrd, Ord)] + #[derive(PartialEq, Eq, PartialOrd, Ord)] pub struct ContravariantType; impl Copy for ContravariantType {} @@ -210,7 +210,7 @@ pub mod marker { /// never written, but in fact `Cell` uses unsafe code to achieve /// interior mutability. #[lang="invariant_type"] - #[deriving(PartialEq, Eq, PartialOrd, Ord)] + #[derive(PartialEq, Eq, PartialOrd, Ord)] pub struct InvariantType; impl Copy for InvariantType {} @@ -235,7 +235,7 @@ pub mod marker { /// For more information about variance, refer to this Wikipedia /// article . #[lang="covariant_lifetime"] - #[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] + #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct CovariantLifetime<'a>; /// As `ContravariantType`, but for lifetime parameters. Using @@ -251,7 +251,7 @@ pub mod marker { /// For more information about variance, refer to this Wikipedia /// article . #[lang="contravariant_lifetime"] - #[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] + #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct ContravariantLifetime<'a>; /// As `InvariantType`, but for lifetime parameters. Using @@ -262,7 +262,7 @@ pub mod marker { /// and this pointer is itself stored in an inherently mutable /// location (such as a `Cell`). #[lang="invariant_lifetime"] - #[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] + #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct InvariantLifetime<'a>; /// A type which is considered "not sendable", meaning that it cannot @@ -270,14 +270,14 @@ pub mod marker { /// typically embedded in other types, such as `Gc`, to ensure that /// their instances remain thread-local. #[lang="no_send_bound"] - #[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] + #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct NoSend; /// A type which is considered "not POD", meaning that it is not /// implicitly copyable. This is typically embedded in other types to /// ensure that they are never copied, even if they lack a destructor. #[lang="no_copy_bound"] - #[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)] + #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] #[allow(missing_copy_implementations)] pub struct NoCopy; @@ -285,13 +285,13 @@ pub mod marker { /// its contents are not threadsafe, hence they cannot be /// shared between tasks. #[lang="no_sync_bound"] - #[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] + #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct NoSync; /// A type which is considered managed by the GC. This is typically /// embedded in other types. #[lang="managed_bound"] - #[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)] + #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] #[allow(missing_copy_implementations)] pub struct Managed; } diff --git a/src/libcore/nonzero.rs b/src/libcore/nonzero.rs index c429e4b8212bc..a5a80f989e761 100644 --- a/src/libcore/nonzero.rs +++ b/src/libcore/nonzero.rs @@ -31,7 +31,7 @@ unsafe impl Zeroable for u64 {} /// A wrapper type for raw pointers and integers that will never be /// NULL or 0 that might allow certain optimizations. #[lang="non_zero"] -#[deriving(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Show)] +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Show)] #[experimental] pub struct NonZero(T); diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 0d2ce4f60718f..19396a7a4e090 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -1218,7 +1218,7 @@ impl_num_cast! { f32, to_f32 } impl_num_cast! { f64, to_f64 } /// Used for representing the classification of floating point numbers -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] #[unstable = "may be renamed"] pub enum FpCategory { /// "Not a Number", often obtained by dividing by zero diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index af07869e95feb..26f08caead84c 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -25,7 +25,7 @@ //! demonstrates adding and subtracting two `Point`s. //! //! ```rust -//! #[deriving(Show)] +//! #[derive(Show)] //! struct Point { //! x: int, //! y: int @@ -91,7 +91,7 @@ pub trait Drop { /// calling `add`, and therefore, `main` prints `Adding!`. /// /// ```rust -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Add for Foo { @@ -130,7 +130,7 @@ add_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// calling `sub`, and therefore, `main` prints `Subtracting!`. /// /// ```rust -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Sub for Foo { @@ -169,7 +169,7 @@ sub_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// calling `mul`, and therefore, `main` prints `Multiplying!`. /// /// ```rust -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Mul for Foo { @@ -208,7 +208,7 @@ mul_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// calling `div`, and therefore, `main` prints `Dividing!`. /// /// ``` -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Div for Foo { @@ -247,7 +247,7 @@ div_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// calling `rem`, and therefore, `main` prints `Remainder-ing!`. /// /// ``` -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Rem for Foo { @@ -396,7 +396,7 @@ not_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// calling `bitand`, and therefore, `main` prints `Bitwise And-ing!`. /// /// ``` -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl BitAnd for Foo { @@ -435,7 +435,7 @@ bitand_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// calling `bitor`, and therefore, `main` prints `Bitwise Or-ing!`. /// /// ``` -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl BitOr for Foo { @@ -474,7 +474,7 @@ bitor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// calling `bitxor`, and therefore, `main` prints `Bitwise Xor-ing!`. /// /// ``` -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl BitXor for Foo { @@ -513,7 +513,7 @@ bitxor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// calling `shl`, and therefore, `main` prints `Shifting left!`. /// /// ``` -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Shl for Foo { @@ -554,7 +554,7 @@ shl_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// calling `shr`, and therefore, `main` prints `Shifting right!`. /// /// ``` -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Shr for Foo { @@ -594,7 +594,7 @@ shr_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// calling `index`, and therefore, `main` prints `Indexing!`. /// /// ``` -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Index for Foo { @@ -623,7 +623,7 @@ pub trait Index for Sized? { /// calling `index_mut`, and therefore, `main` prints `Indexing!`. /// /// ``` -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl IndexMut for Foo { @@ -652,7 +652,7 @@ pub trait IndexMut for Sized? { /// calling `slice_to`, and therefore, `main` prints `Slicing!`. /// /// ```ignore -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Slice for Foo { @@ -699,7 +699,7 @@ pub trait Slice for Sized? { /// calling `slice_from_mut`, and therefore, `main` prints `Slicing!`. /// /// ```ignore -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl SliceMut for Foo { @@ -739,12 +739,12 @@ pub trait SliceMut for Sized? { /// An unbounded range. -#[deriving(Copy)] +#[derive(Copy)] #[lang="full_range"] pub struct FullRange; /// A (half-open) range which is bounded at both ends. -#[deriving(Copy)] +#[derive(Copy)] #[lang="range"] pub struct Range { /// The lower bound of the range (inclusive). @@ -792,7 +792,7 @@ impl DoubleEndedIterator for Range { impl ExactSizeIterator for Range {} /// A range which is only bounded below. -#[deriving(Copy)] +#[derive(Copy)] #[lang="range_from"] pub struct RangeFrom { /// The lower bound of the range (inclusive). @@ -810,7 +810,7 @@ impl Iterator for RangeFrom { } /// A range which is only bounded above. -#[deriving(Copy)] +#[derive(Copy)] #[lang="range_to"] pub struct RangeTo { /// The upper bound of the range (exclusive). diff --git a/src/libcore/option.rs b/src/libcore/option.rs index d831a57893bd7..0fc2f17f2ea52 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -163,7 +163,7 @@ use ops::{Deref, FnOnce}; // which basically means it must be `Option`. /// The `Option` type. -#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)] +#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)] #[stable] pub enum Option { /// No value @@ -772,7 +772,7 @@ impl Default for Option { // The Option Iterators ///////////////////////////////////////////////////////////////////////////// -#[deriving(Clone)] +#[derive(Clone)] struct Item { opt: Option } diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs index d70c96d8c1662..3bef1d1536377 100644 --- a/src/libcore/raw.rs +++ b/src/libcore/raw.rs @@ -33,7 +33,7 @@ impl Copy for Slice {} /// The representation of a Rust closure #[repr(C)] -#[deriving(Copy)] +#[derive(Copy)] pub struct Closure { pub code: *mut (), pub env: *mut (), @@ -44,7 +44,7 @@ pub struct Closure { /// This struct does not have a `Repr` implementation /// because there is no way to refer to all trait objects generically. #[repr(C)] -#[deriving(Copy)] +#[derive(Copy)] pub struct TraitObject { pub data: *mut (), pub vtable: *mut (), diff --git a/src/libcore/result.rs b/src/libcore/result.rs index bd1c6dbcf1e9a..61a8dab89d1c6 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -30,7 +30,7 @@ //! defined and used like so: //! //! ``` -//! #[deriving(Show)] +//! #[derive(Show)] //! enum Version { Version1, Version2 } //! //! fn parse_version(header: &[u8]) -> Result { @@ -243,7 +243,7 @@ use slice; /// `Result` is a type that represents either success (`Ok`) or failure (`Err`). /// /// See the [`std::result`](index.html) module documentation for details. -#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)] +#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)] #[must_use] #[stable] pub enum Result { diff --git a/src/libcore/simd.rs b/src/libcore/simd.rs index 0b0e6ff95c659..66b29bab98c24 100644 --- a/src/libcore/simd.rs +++ b/src/libcore/simd.rs @@ -39,7 +39,7 @@ #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct i8x16(pub i8, pub i8, pub i8, pub i8, pub i8, pub i8, pub i8, pub i8, @@ -48,26 +48,26 @@ pub struct i8x16(pub i8, pub i8, pub i8, pub i8, #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct i16x8(pub i16, pub i16, pub i16, pub i16, pub i16, pub i16, pub i16, pub i16); #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct i32x4(pub i32, pub i32, pub i32, pub i32); #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct i64x2(pub i64, pub i64); #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct u8x16(pub u8, pub u8, pub u8, pub u8, pub u8, pub u8, pub u8, pub u8, @@ -76,31 +76,31 @@ pub struct u8x16(pub u8, pub u8, pub u8, pub u8, #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct u16x8(pub u16, pub u16, pub u16, pub u16, pub u16, pub u16, pub u16, pub u16); #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct u32x4(pub u32, pub u32, pub u32, pub u32); #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct u64x2(pub u64, pub u64); #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct f32x4(pub f32, pub f32, pub f32, pub f32); #[experimental] #[simd] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] #[repr(C)] pub struct f64x2(pub f64, pub f64); diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 7d894ac697be2..beb8a004e0570 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -908,7 +908,7 @@ pub struct Split<'a, T:'a, P> where P: FnMut(&T) -> bool { finished: bool } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` #[stable] impl<'a, T, P> Clone for Split<'a, T, P> where P: Clone + FnMut(&T) -> bool { fn clone(&self) -> Split<'a, T, P> { @@ -1126,7 +1126,7 @@ forward_iterator! { SplitNMut: T, &'a mut [T] } forward_iterator! { RSplitNMut: T, &'a mut [T] } /// An iterator over overlapping subslices of length `size`. -#[deriving(Clone)] +#[derive(Clone)] #[experimental = "needs review"] pub struct Windows<'a, T:'a> { v: &'a [T], @@ -1161,7 +1161,7 @@ impl<'a, T> Iterator<&'a [T]> for Windows<'a, T> { /// /// When the slice len is not evenly divided by the chunk size, the last slice /// of the iteration will be the remainder. -#[deriving(Clone)] +#[derive(Clone)] #[experimental = "needs review"] pub struct Chunks<'a, T:'a> { v: &'a [T], diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index f4fe86a0d7ec0..96831a2e8bccd 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -141,7 +141,7 @@ Section: Creating a string */ /// Errors which can occur when attempting to interpret a byte slice as a `str`. -#[deriving(Copy, Eq, PartialEq, Clone)] +#[derive(Copy, Eq, PartialEq, Clone)] pub enum Utf8Error { /// An invalid byte was detected at the byte offset given. /// @@ -246,7 +246,7 @@ Section: Iterators /// Iterator for the char (representing *Unicode Scalar Values*) of a string /// /// Created with the method `.chars()`. -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct Chars<'a> { iter: slice::Iter<'a, u8> } @@ -353,7 +353,7 @@ impl<'a> DoubleEndedIterator for Chars<'a> { /// External iterator for a string's characters and their byte offsets. /// Use with the `std::iter` module. -#[deriving(Clone)] +#[derive(Clone)] pub struct CharIndices<'a> { front_offset: uint, iter: Chars<'a>, @@ -399,13 +399,13 @@ impl<'a> DoubleEndedIterator<(uint, char)> for CharIndices<'a> { /// /// Created with `StrExt::bytes` #[stable] -#[deriving(Clone)] +#[derive(Clone)] pub struct Bytes<'a>(Map<&'a u8, u8, slice::Iter<'a, u8>, BytesDeref>); delegate_iter!{exact u8 in Bytes<'a>} /// A temporary fn new type that ensures that the `Bytes` iterator /// is cloneable. -#[deriving(Copy, Clone)] +#[derive(Copy, Clone)] struct BytesDeref; impl<'a> Fn(&'a u8) -> u8 for BytesDeref { @@ -416,7 +416,7 @@ impl<'a> Fn(&'a u8) -> u8 for BytesDeref { } /// An iterator over the substrings of a string, separated by `sep`. -#[deriving(Clone)] +#[derive(Clone)] #[deprecated = "Type is now named `Split` or `SplitTerminator`"] pub struct CharSplits<'a, Sep> { /// The slice remaining to be iterated @@ -430,7 +430,7 @@ pub struct CharSplits<'a, Sep> { /// An iterator over the substrings of a string, separated by `sep`, /// splitting at most `count` times. -#[deriving(Clone)] +#[derive(Clone)] #[deprecated = "Type is now named `SplitN` or `RSplitN`"] pub struct CharSplitsN<'a, Sep> { iter: CharSplits<'a, Sep>, @@ -551,7 +551,7 @@ impl<'a, Sep: CharEq> Iterator<&'a str> for CharSplitsN<'a, Sep> { /// The internal state of an iterator that searches for matches of a substring /// within a larger string using naive search -#[deriving(Clone)] +#[derive(Clone)] struct NaiveSearcher { position: uint } @@ -577,7 +577,7 @@ impl NaiveSearcher { /// The internal state of an iterator that searches for matches of a substring /// within a larger string using two-way search -#[deriving(Clone)] +#[derive(Clone)] struct TwoWaySearcher { // constants crit_pos: uint, @@ -814,7 +814,7 @@ impl TwoWaySearcher { /// The internal state of an iterator that searches for matches of a substring /// within a larger string using a dynamically chosen search algorithm -#[deriving(Clone)] +#[derive(Clone)] enum Searcher { Naive(NaiveSearcher), TwoWay(TwoWaySearcher), @@ -842,7 +842,7 @@ impl Searcher { /// An iterator over the start and end indices of the matches of a /// substring within a larger string -#[deriving(Clone)] +#[derive(Clone)] pub struct MatchIndices<'a> { // constants haystack: &'a str, @@ -852,7 +852,7 @@ pub struct MatchIndices<'a> { /// An iterator over the substrings of a string separated by a given /// search string -#[deriving(Clone)] +#[derive(Clone)] #[unstable = "Type might get removed"] pub struct SplitStr<'a> { it: MatchIndices<'a>, @@ -1056,7 +1056,7 @@ pub fn utf8_char_width(b: u8) -> uint { /// Struct that contains a `char` and the index of the first byte of /// the next `char` in a string. This can be used as a data structure /// for iterating over the UTF-8 bytes of a string. -#[deriving(Copy)] +#[derive(Copy)] #[unstable = "naming is uncertain with container conventions"] pub struct CharRange { /// Current `char` @@ -1232,25 +1232,25 @@ impl<'a, Sized? S> Str for &'a S where S: Str { } /// Return type of `StrExt::split` -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct Split<'a, P>(CharSplits<'a, P>); delegate_iter!{pattern &'a str in Split<'a, P>} /// Return type of `StrExt::split_terminator` -#[deriving(Clone)] +#[derive(Clone)] #[unstable = "might get removed in favour of a constructor method on Split"] pub struct SplitTerminator<'a, P>(CharSplits<'a, P>); delegate_iter!{pattern &'a str in SplitTerminator<'a, P>} /// Return type of `StrExt::splitn` -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct SplitN<'a, P>(CharSplitsN<'a, P>); delegate_iter!{pattern forward &'a str in SplitN<'a, P>} /// Return type of `StrExt::rsplitn` -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct RSplitN<'a, P>(CharSplitsN<'a, P>); delegate_iter!{pattern forward &'a str in RSplitN<'a, P>} diff --git a/src/libcoretest/any.rs b/src/libcoretest/any.rs index e9e2028dc6147..9b0471bfad936 100644 --- a/src/libcoretest/any.rs +++ b/src/libcoretest/any.rs @@ -11,7 +11,7 @@ use core::any::*; use test::Bencher; use test; -#[deriving(PartialEq, Show)] +#[derive(PartialEq, Show)] struct Test; static TEST: &'static str = "Test"; diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index c284fb7c9e338..febef9f57b7fe 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -36,7 +36,7 @@ use std::string; /// A piece is a portion of the format string which represents the next part /// to emit. These are emitted as a stream by the `Parser` class. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Piece<'a> { /// A literal string which should directly be emitted String(&'a str), @@ -46,7 +46,7 @@ pub enum Piece<'a> { } /// Representation of an argument specification. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub struct Argument<'a> { /// Where to find this argument pub position: Position<'a>, @@ -55,7 +55,7 @@ pub struct Argument<'a> { } /// Specification for the formatting of an argument in the format string. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub struct FormatSpec<'a> { /// Optionally specified character to fill alignment with pub fill: Option, @@ -74,7 +74,7 @@ pub struct FormatSpec<'a> { } /// Enum describing where an argument for a format can be located. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Position<'a> { /// The argument will be in the next position. This is the default. ArgumentNext, @@ -85,7 +85,7 @@ pub enum Position<'a> { } /// Enum of alignments which are supported. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Alignment { /// The value will be aligned to the left. AlignLeft, @@ -99,7 +99,7 @@ pub enum Alignment { /// Various flags which can be applied to format strings. The meaning of these /// flags is defined by the formatters themselves. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Flag { /// A `+` will be used to denote positive numbers. FlagSignPlus, @@ -115,7 +115,7 @@ pub enum Flag { /// A count is used for the precision and width parameters of an integer, and /// can reference either an argument or a literal integer. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Count<'a> { /// The count is specified explicitly. CountIs(uint), diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index 0db0bd413ac94..2063654077f15 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -105,7 +105,7 @@ use std::iter::repeat; use std::result; /// Name of an option. Either a string or a single char. -#[deriving(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] pub enum Name { /// A string representing the long name of an option. /// For example: "help" @@ -116,7 +116,7 @@ pub enum Name { } /// Describes whether an option has an argument. -#[deriving(Clone, Copy, PartialEq, Eq)] +#[derive(Clone, Copy, PartialEq, Eq)] pub enum HasArg { /// The option requires an argument. Yes, @@ -127,7 +127,7 @@ pub enum HasArg { } /// Describes how often an option may occur. -#[deriving(Clone, Copy, PartialEq, Eq)] +#[derive(Clone, Copy, PartialEq, Eq)] pub enum Occur { /// The option occurs once. Req, @@ -138,7 +138,7 @@ pub enum Occur { } /// A description of a possible option. -#[deriving(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] pub struct Opt { /// Name of the option pub name: Name, @@ -152,7 +152,7 @@ pub struct Opt { /// One group of options, e.g., both `-h` and `--help`, along with /// their shared description and properties. -#[deriving(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] pub struct OptGroup { /// Short name of the option, e.g. `h` for a `-h` option pub short_name: String, @@ -169,7 +169,7 @@ pub struct OptGroup { } /// Describes whether an option is given at all or has a value. -#[deriving(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] enum Optval { Val(String), Given, @@ -177,7 +177,7 @@ enum Optval { /// The result of checking command line arguments. Contains a vector /// of matches and a vector of free strings. -#[deriving(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] pub struct Matches { /// Options that matched opts: Vec, @@ -190,7 +190,7 @@ pub struct Matches { /// The type returned when the command line does not conform to the /// expected format. Use the `Show` implementation to output detailed /// information. -#[deriving(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] pub enum Fail { /// The option requires an argument but none was passed. ArgumentMissing(String), @@ -205,7 +205,7 @@ pub enum Fail { } /// The type of failure that occurred. -#[deriving(Copy, PartialEq, Eq)] +#[derive(Copy, PartialEq, Eq)] #[allow(missing_docs)] pub enum FailType { ArgumentMissing_, @@ -827,18 +827,18 @@ pub fn short_usage(program_name: &str, opts: &[OptGroup]) -> String { line } -#[deriving(Copy)] +#[derive(Copy)] enum SplitWithinState { A, // leading whitespace, initial state B, // words C, // internal and trailing whitespace } -#[deriving(Copy)] +#[derive(Copy)] enum Whitespace { Ws, // current char is whitespace Cr // current char is not whitespace } -#[deriving(Copy)] +#[derive(Copy)] enum LengthLimit { UnderLim, // current char makes current substring still fit in limit OverLim // current char makes current substring no longer fit in limit diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index 7dd0649e4837d..60d54a98abb3f 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -513,7 +513,7 @@ pub trait GraphWalk<'a, N, E> { fn target(&'a self, edge: &E) -> N; } -#[deriving(Copy, PartialEq, Eq, Show)] +#[derive(Copy, PartialEq, Eq, Show)] pub enum RenderOption { NoEdgeLabels, NoNodeLabels, diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 9faaedc45f3b1..8f1919280a660 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -386,7 +386,7 @@ pub mod types { pub type pthread_t = c_ulong; #[repr(C)] - #[deriving(Copy)] pub struct glob_t { + #[derive(Copy)] pub struct glob_t { pub gl_pathc: size_t, pub gl_pathv: *mut *mut c_char, pub gl_offs: size_t, @@ -399,18 +399,18 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct timeval { + #[derive(Copy)] pub struct timeval { pub tv_sec: time_t, pub tv_usec: suseconds_t, } #[repr(C)] - #[deriving(Copy)] pub struct timespec { + #[derive(Copy)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: c_long, } - #[deriving(Copy)] pub enum timezone {} + #[derive(Copy)] pub enum timezone {} pub type sighandler_t = size_t; } @@ -423,29 +423,29 @@ pub mod types { pub type in_port_t = u16; pub type in_addr_t = u32; #[repr(C)] - #[deriving(Copy)] pub struct sockaddr { + #[derive(Copy)] pub struct sockaddr { pub sa_family: sa_family_t, pub sa_data: [u8; 14], } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_storage { + #[derive(Copy)] pub struct sockaddr_storage { pub ss_family: sa_family_t, pub __ss_align: i64, pub __ss_pad2: [u8; 112], } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in { + #[derive(Copy)] pub struct sockaddr_in { pub sin_family: sa_family_t, pub sin_port: in_port_t, pub sin_addr: in_addr, pub sin_zero: [u8; 8], } #[repr(C)] - #[deriving(Copy)] pub struct in_addr { + #[derive(Copy)] pub struct in_addr { pub s_addr: in_addr_t, } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in6 { + #[derive(Copy)] pub struct sockaddr_in6 { pub sin6_family: sa_family_t, pub sin6_port: in_port_t, pub sin6_flowinfo: u32, @@ -453,21 +453,21 @@ pub mod types { pub sin6_scope_id: u32, } #[repr(C)] - #[deriving(Copy)] pub struct in6_addr { + #[derive(Copy)] pub struct in6_addr { pub s6_addr: [u16; 8] } #[repr(C)] - #[deriving(Copy)] pub struct ip_mreq { + #[derive(Copy)] pub struct ip_mreq { pub imr_multiaddr: in_addr, pub imr_interface: in_addr, } #[repr(C)] - #[deriving(Copy)] pub struct ip6_mreq { + #[derive(Copy)] pub struct ip6_mreq { pub ipv6mr_multiaddr: in6_addr, pub ipv6mr_interface: c_uint, } #[repr(C)] - #[deriving(Copy)] pub struct addrinfo { + #[derive(Copy)] pub struct addrinfo { pub ai_flags: c_int, pub ai_family: c_int, pub ai_socktype: c_int, @@ -489,13 +489,13 @@ pub mod types { pub ai_next: *mut addrinfo, } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_un { + #[derive(Copy)] pub struct sockaddr_un { pub sun_family: sa_family_t, pub sun_path: [c_char; 108] } #[repr(C)] - #[deriving(Copy)] pub struct ifaddrs { + #[derive(Copy)] pub struct ifaddrs { pub ifa_next: *mut ifaddrs, pub ifa_name: *mut c_char, pub ifa_flags: c_uint, @@ -578,7 +578,7 @@ pub mod types { pub type blkcnt_t = i32; #[repr(C)] - #[deriving(Copy)] pub struct stat { + #[derive(Copy)] pub struct stat { pub st_dev: dev_t, pub __pad1: c_short, pub st_ino: ino_t, @@ -602,13 +602,13 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time_t, pub modtime: time_t, } #[repr(C)] - #[deriving(Copy)] pub struct pthread_attr_t { + #[derive(Copy)] pub struct pthread_attr_t { pub __size: [u32; 9] } } @@ -623,7 +623,7 @@ pub mod types { pub type blkcnt_t = u32; #[repr(C)] - #[deriving(Copy)] pub struct stat { + #[derive(Copy)] pub struct stat { pub st_dev: c_ulonglong, pub __pad0: [c_uchar; 4], pub __st_ino: ino_t, @@ -646,13 +646,13 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time_t, pub modtime: time_t, } #[repr(C)] - #[deriving(Copy)] pub struct pthread_attr_t { + #[derive(Copy)] pub struct pthread_attr_t { pub __size: [u32; 9] } } @@ -668,7 +668,7 @@ pub mod types { pub type blkcnt_t = i32; #[repr(C)] - #[deriving(Copy)] pub struct stat { + #[derive(Copy)] pub struct stat { pub st_dev: c_ulong, pub st_pad1: [c_long; 3], pub st_ino: ino_t, @@ -692,13 +692,13 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time_t, pub modtime: time_t, } #[repr(C)] - #[deriving(Copy)] pub struct pthread_attr_t { + #[derive(Copy)] pub struct pthread_attr_t { pub __size: [u32; 9] } } @@ -707,7 +707,7 @@ pub mod types { pub mod extra { use types::os::arch::c95::{c_ushort, c_int, c_uchar}; #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_ll { + #[derive(Copy)] pub struct sockaddr_ll { pub sll_family: c_ushort, pub sll_protocol: c_ushort, pub sll_ifindex: c_int, @@ -770,7 +770,7 @@ pub mod types { pub type blksize_t = i64; pub type blkcnt_t = i64; #[repr(C)] - #[deriving(Copy)] pub struct stat { + #[derive(Copy)] pub struct stat { pub st_dev: dev_t, pub st_ino: ino_t, pub st_nlink: nlink_t, @@ -792,13 +792,13 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time_t, pub modtime: time_t, } #[repr(C)] - #[deriving(Copy)] pub struct pthread_attr_t { + #[derive(Copy)] pub struct pthread_attr_t { pub __size: [u64; 7] } } @@ -808,7 +808,7 @@ pub mod types { } pub mod extra { use types::os::arch::c95::{c_ushort, c_int, c_uchar}; - #[deriving(Copy)] pub struct sockaddr_ll { + #[derive(Copy)] pub struct sockaddr_ll { pub sll_family: c_ushort, pub sll_protocol: c_ushort, pub sll_ifindex: c_int, @@ -834,7 +834,7 @@ pub mod types { pub type pthread_t = uintptr_t; #[repr(C)] - #[deriving(Copy)] pub struct glob_t { + #[derive(Copy)] pub struct glob_t { pub gl_pathc: size_t, pub __unused1: size_t, pub gl_offs: size_t, @@ -851,18 +851,18 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct timeval { + #[derive(Copy)] pub struct timeval { pub tv_sec: time_t, pub tv_usec: suseconds_t, } #[repr(C)] - #[deriving(Copy)] pub struct timespec { + #[derive(Copy)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: c_long, } - #[deriving(Copy)] pub enum timezone {} + #[derive(Copy)] pub enum timezone {} pub type sighandler_t = size_t; } @@ -875,13 +875,13 @@ pub mod types { pub type in_port_t = u16; pub type in_addr_t = u32; #[repr(C)] - #[deriving(Copy)] pub struct sockaddr { + #[derive(Copy)] pub struct sockaddr { pub sa_len: u8, pub sa_family: sa_family_t, pub sa_data: [u8; 14], } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_storage { + #[derive(Copy)] pub struct sockaddr_storage { pub ss_len: u8, pub ss_family: sa_family_t, pub __ss_pad1: [u8; 6], @@ -889,7 +889,7 @@ pub mod types { pub __ss_pad2: [u8; 112], } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in { + #[derive(Copy)] pub struct sockaddr_in { pub sin_len: u8, pub sin_family: sa_family_t, pub sin_port: in_port_t, @@ -897,11 +897,11 @@ pub mod types { pub sin_zero: [u8; 8], } #[repr(C)] - #[deriving(Copy)] pub struct in_addr { + #[derive(Copy)] pub struct in_addr { pub s_addr: in_addr_t, } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in6 { + #[derive(Copy)] pub struct sockaddr_in6 { pub sin6_len: u8, pub sin6_family: sa_family_t, pub sin6_port: in_port_t, @@ -910,21 +910,21 @@ pub mod types { pub sin6_scope_id: u32, } #[repr(C)] - #[deriving(Copy)] pub struct in6_addr { + #[derive(Copy)] pub struct in6_addr { pub s6_addr: [u16; 8] } #[repr(C)] - #[deriving(Copy)] pub struct ip_mreq { + #[derive(Copy)] pub struct ip_mreq { pub imr_multiaddr: in_addr, pub imr_interface: in_addr, } #[repr(C)] - #[deriving(Copy)] pub struct ip6_mreq { + #[derive(Copy)] pub struct ip6_mreq { pub ipv6mr_multiaddr: in6_addr, pub ipv6mr_interface: c_uint, } #[repr(C)] - #[deriving(Copy)] pub struct addrinfo { + #[derive(Copy)] pub struct addrinfo { pub ai_flags: c_int, pub ai_family: c_int, pub ai_socktype: c_int, @@ -935,13 +935,13 @@ pub mod types { pub ai_next: *mut addrinfo, } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_un { + #[derive(Copy)] pub struct sockaddr_un { pub sun_len: u8, pub sun_family: sa_family_t, pub sun_path: [c_char; 104] } #[repr(C)] - #[deriving(Copy)] pub struct ifaddrs { + #[derive(Copy)] pub struct ifaddrs { pub ifa_next: *mut ifaddrs, pub ifa_name: *mut c_char, pub ifa_flags: c_uint, @@ -1008,7 +1008,7 @@ pub mod types { pub type blkcnt_t = i64; pub type fflags_t = u32; #[repr(C)] - #[deriving(Copy)] pub struct stat { + #[derive(Copy)] pub struct stat { pub st_dev: dev_t, pub st_ino: ino_t, pub st_mode: mode_t, @@ -1034,7 +1034,7 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time_t, pub modtime: time_t, } @@ -1062,7 +1062,7 @@ pub mod types { pub type pthread_t = uintptr_t; #[repr(C)] - #[deriving(Copy)] pub struct glob_t { + #[derive(Copy)] pub struct glob_t { pub gl_pathc: size_t, pub __unused1: size_t, pub gl_offs: size_t, @@ -1079,18 +1079,18 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct timeval { + #[derive(Copy)] pub struct timeval { pub tv_sec: time_t, pub tv_usec: suseconds_t, } #[repr(C)] - #[deriving(Copy)] pub struct timespec { + #[derive(Copy)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: c_long, } - #[deriving(Copy)] pub enum timezone {} + #[derive(Copy)] pub enum timezone {} pub type sighandler_t = size_t; } @@ -1103,13 +1103,13 @@ pub mod types { pub type in_port_t = u16; pub type in_addr_t = u32; #[repr(C)] - #[deriving(Copy)] pub struct sockaddr { + #[derive(Copy)] pub struct sockaddr { pub sa_len: u8, pub sa_family: sa_family_t, pub sa_data: [u8; 14], } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_storage { + #[derive(Copy)] pub struct sockaddr_storage { pub ss_len: u8, pub ss_family: sa_family_t, pub __ss_pad1: [u8; 6], @@ -1117,7 +1117,7 @@ pub mod types { pub __ss_pad2: [u8; 112], } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in { + #[derive(Copy)] pub struct sockaddr_in { pub sin_len: u8, pub sin_family: sa_family_t, pub sin_port: in_port_t, @@ -1125,11 +1125,11 @@ pub mod types { pub sin_zero: [u8; 8], } #[repr(C)] - #[deriving(Copy)] pub struct in_addr { + #[derive(Copy)] pub struct in_addr { pub s_addr: in_addr_t, } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in6 { + #[derive(Copy)] pub struct sockaddr_in6 { pub sin6_len: u8, pub sin6_family: sa_family_t, pub sin6_port: in_port_t, @@ -1138,21 +1138,21 @@ pub mod types { pub sin6_scope_id: u32, } #[repr(C)] - #[deriving(Copy)] pub struct in6_addr { + #[derive(Copy)] pub struct in6_addr { pub s6_addr: [u16; 8] } #[repr(C)] - #[deriving(Copy)] pub struct ip_mreq { + #[derive(Copy)] pub struct ip_mreq { pub imr_multiaddr: in_addr, pub imr_interface: in_addr, } #[repr(C)] - #[deriving(Copy)] pub struct ip6_mreq { + #[derive(Copy)] pub struct ip6_mreq { pub ipv6mr_multiaddr: in6_addr, pub ipv6mr_interface: c_uint, } #[repr(C)] - #[deriving(Copy)] pub struct addrinfo { + #[derive(Copy)] pub struct addrinfo { pub ai_flags: c_int, pub ai_family: c_int, pub ai_socktype: c_int, @@ -1163,13 +1163,13 @@ pub mod types { pub ai_next: *mut addrinfo, } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_un { + #[derive(Copy)] pub struct sockaddr_un { pub sun_len: u8, pub sun_family: sa_family_t, pub sun_path: [c_char; 104] } #[repr(C)] - #[deriving(Copy)] pub struct ifaddrs { + #[derive(Copy)] pub struct ifaddrs { pub ifa_next: *mut ifaddrs, pub ifa_name: *mut c_char, pub ifa_flags: c_uint, @@ -1237,7 +1237,7 @@ pub mod types { pub type fflags_t = u32; #[repr(C)] - #[deriving(Copy)] pub struct stat { + #[derive(Copy)] pub struct stat { pub st_ino: ino_t, pub st_nlink: nlink_t, pub st_dev: dev_t, @@ -1262,7 +1262,7 @@ pub mod types { pub st_qspare2: int64_t, } #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time_t, pub modtime: time_t, } @@ -1289,7 +1289,7 @@ pub mod types { // pub Note: this is the struct called stat64 in Windows. Not stat, // nor stati64. #[repr(C)] - #[deriving(Copy)] pub struct stat { + #[derive(Copy)] pub struct stat { pub st_dev: dev_t, pub st_ino: ino_t, pub st_mode: u16, @@ -1305,24 +1305,24 @@ pub mod types { // note that this is called utimbuf64 in Windows #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time64_t, pub modtime: time64_t, } #[repr(C)] - #[deriving(Copy)] pub struct timeval { + #[derive(Copy)] pub struct timeval { pub tv_sec: c_long, pub tv_usec: c_long, } #[repr(C)] - #[deriving(Copy)] pub struct timespec { + #[derive(Copy)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: c_long, } - #[deriving(Copy)] pub enum timezone {} + #[derive(Copy)] pub enum timezone {} } pub mod bsd44 { @@ -1335,30 +1335,30 @@ pub mod types { pub type in_port_t = u16; pub type in_addr_t = u32; #[repr(C)] - #[deriving(Copy)] pub struct sockaddr { + #[derive(Copy)] pub struct sockaddr { pub sa_family: sa_family_t, pub sa_data: [u8; 14], } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_storage { + #[derive(Copy)] pub struct sockaddr_storage { pub ss_family: sa_family_t, pub __ss_pad1: [u8; 6], pub __ss_align: i64, pub __ss_pad2: [u8; 112], } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in { + #[derive(Copy)] pub struct sockaddr_in { pub sin_family: sa_family_t, pub sin_port: in_port_t, pub sin_addr: in_addr, pub sin_zero: [u8; 8], } #[repr(C)] - #[deriving(Copy)] pub struct in_addr { + #[derive(Copy)] pub struct in_addr { pub s_addr: in_addr_t, } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in6 { + #[derive(Copy)] pub struct sockaddr_in6 { pub sin6_family: sa_family_t, pub sin6_port: in_port_t, pub sin6_flowinfo: u32, @@ -1366,21 +1366,21 @@ pub mod types { pub sin6_scope_id: u32, } #[repr(C)] - #[deriving(Copy)] pub struct in6_addr { + #[derive(Copy)] pub struct in6_addr { pub s6_addr: [u16; 8] } #[repr(C)] - #[deriving(Copy)] pub struct ip_mreq { + #[derive(Copy)] pub struct ip_mreq { pub imr_multiaddr: in_addr, pub imr_interface: in_addr, } #[repr(C)] - #[deriving(Copy)] pub struct ip6_mreq { + #[derive(Copy)] pub struct ip6_mreq { pub ipv6mr_multiaddr: in6_addr, pub ipv6mr_interface: c_uint, } #[repr(C)] - #[deriving(Copy)] pub struct addrinfo { + #[derive(Copy)] pub struct addrinfo { pub ai_flags: c_int, pub ai_family: c_int, pub ai_socktype: c_int, @@ -1391,7 +1391,7 @@ pub mod types { pub ai_next: *mut addrinfo, } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_un { + #[derive(Copy)] pub struct sockaddr_un { pub sun_family: sa_family_t, pub sun_path: [c_char; 108] } @@ -1519,7 +1519,7 @@ pub mod types { pub type LPCH = *mut CHAR; #[repr(C)] - #[deriving(Copy)] pub struct SECURITY_ATTRIBUTES { + #[derive(Copy)] pub struct SECURITY_ATTRIBUTES { pub nLength: DWORD, pub lpSecurityDescriptor: LPVOID, pub bInheritHandle: BOOL, @@ -1543,7 +1543,7 @@ pub mod types { pub type int64 = i64; #[repr(C)] - #[deriving(Copy)] pub struct STARTUPINFO { + #[derive(Copy)] pub struct STARTUPINFO { pub cb: DWORD, pub lpReserved: LPWSTR, pub lpDesktop: LPWSTR, @@ -1566,7 +1566,7 @@ pub mod types { pub type LPSTARTUPINFO = *mut STARTUPINFO; #[repr(C)] - #[deriving(Copy)] pub struct PROCESS_INFORMATION { + #[derive(Copy)] pub struct PROCESS_INFORMATION { pub hProcess: HANDLE, pub hThread: HANDLE, pub dwProcessId: DWORD, @@ -1575,7 +1575,7 @@ pub mod types { pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION; #[repr(C)] - #[deriving(Copy)] pub struct SYSTEM_INFO { + #[derive(Copy)] pub struct SYSTEM_INFO { pub wProcessorArchitecture: WORD, pub wReserved: WORD, pub dwPageSize: DWORD, @@ -1591,7 +1591,7 @@ pub mod types { pub type LPSYSTEM_INFO = *mut SYSTEM_INFO; #[repr(C)] - #[deriving(Copy)] pub struct MEMORY_BASIC_INFORMATION { + #[derive(Copy)] pub struct MEMORY_BASIC_INFORMATION { pub BaseAddress: LPVOID, pub AllocationBase: LPVOID, pub AllocationProtect: DWORD, @@ -1603,7 +1603,7 @@ pub mod types { pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION; #[repr(C)] - #[deriving(Copy)] pub struct OVERLAPPED { + #[derive(Copy)] pub struct OVERLAPPED { pub Internal: *mut c_ulong, pub InternalHigh: *mut c_ulong, pub Offset: DWORD, @@ -1614,7 +1614,7 @@ pub mod types { pub type LPOVERLAPPED = *mut OVERLAPPED; #[repr(C)] - #[deriving(Copy)] pub struct FILETIME { + #[derive(Copy)] pub struct FILETIME { pub dwLowDateTime: DWORD, pub dwHighDateTime: DWORD, } @@ -1622,7 +1622,7 @@ pub mod types { pub type LPFILETIME = *mut FILETIME; #[repr(C)] - #[deriving(Copy)] pub struct GUID { + #[derive(Copy)] pub struct GUID { pub Data1: DWORD, pub Data2: WORD, pub Data3: WORD, @@ -1630,7 +1630,7 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct WSAPROTOCOLCHAIN { + #[derive(Copy)] pub struct WSAPROTOCOLCHAIN { pub ChainLen: c_int, pub ChainEntries: [DWORD; MAX_PROTOCOL_CHAIN as uint], } @@ -1638,7 +1638,7 @@ pub mod types { pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN; #[repr(C)] - #[deriving(Copy)] pub struct WSAPROTOCOL_INFO { + #[derive(Copy)] pub struct WSAPROTOCOL_INFO { pub dwServiceFlags1: DWORD, pub dwServiceFlags2: DWORD, pub dwServiceFlags3: DWORD, @@ -1666,7 +1666,7 @@ pub mod types { pub type GROUP = c_uint; #[repr(C)] - #[deriving(Copy)] pub struct WIN32_FIND_DATAW { + #[derive(Copy)] pub struct WIN32_FIND_DATAW { pub dwFileAttributes: DWORD, pub ftCreationTime: FILETIME, pub ftLastAccessTime: FILETIME, @@ -1696,7 +1696,7 @@ pub mod types { pub type pthread_t = uintptr_t; #[repr(C)] - #[deriving(Copy)] pub struct glob_t { + #[derive(Copy)] pub struct glob_t { pub gl_pathc: size_t, pub __unused1: c_int, pub gl_offs: size_t, @@ -1713,18 +1713,18 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct timeval { + #[derive(Copy)] pub struct timeval { pub tv_sec: time_t, pub tv_usec: suseconds_t, } #[repr(C)] - #[deriving(Copy)] pub struct timespec { + #[derive(Copy)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: c_long, } - #[deriving(Copy)] pub enum timezone {} + #[derive(Copy)] pub enum timezone {} pub type sighandler_t = size_t; } @@ -1738,14 +1738,14 @@ pub mod types { pub type in_port_t = u16; pub type in_addr_t = u32; #[repr(C)] - #[deriving(Copy)] pub struct sockaddr { + #[derive(Copy)] pub struct sockaddr { pub sa_len: u8, pub sa_family: sa_family_t, pub sa_data: [u8; 14], } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_storage { + #[derive(Copy)] pub struct sockaddr_storage { pub ss_len: u8, pub ss_family: sa_family_t, pub __ss_pad1: [u8; 6], @@ -1754,7 +1754,7 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in { + #[derive(Copy)] pub struct sockaddr_in { pub sin_len: u8, pub sin_family: sa_family_t, pub sin_port: in_port_t, @@ -1763,12 +1763,12 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct in_addr { + #[derive(Copy)] pub struct in_addr { pub s_addr: in_addr_t, } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_in6 { + #[derive(Copy)] pub struct sockaddr_in6 { pub sin6_len: u8, pub sin6_family: sa_family_t, pub sin6_port: in_port_t, @@ -1778,24 +1778,24 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct in6_addr { + #[derive(Copy)] pub struct in6_addr { pub s6_addr: [u16; 8] } #[repr(C)] - #[deriving(Copy)] pub struct ip_mreq { + #[derive(Copy)] pub struct ip_mreq { pub imr_multiaddr: in_addr, pub imr_interface: in_addr, } #[repr(C)] - #[deriving(Copy)] pub struct ip6_mreq { + #[derive(Copy)] pub struct ip6_mreq { pub ipv6mr_multiaddr: in6_addr, pub ipv6mr_interface: c_uint, } #[repr(C)] - #[deriving(Copy)] pub struct addrinfo { + #[derive(Copy)] pub struct addrinfo { pub ai_flags: c_int, pub ai_family: c_int, pub ai_socktype: c_int, @@ -1807,14 +1807,14 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct sockaddr_un { + #[derive(Copy)] pub struct sockaddr_un { pub sun_len: u8, pub sun_family: sa_family_t, pub sun_path: [c_char; 104] } #[repr(C)] - #[deriving(Copy)] pub struct ifaddrs { + #[derive(Copy)] pub struct ifaddrs { pub ifa_next: *mut ifaddrs, pub ifa_name: *mut c_char, pub ifa_flags: c_uint, @@ -1877,7 +1877,7 @@ pub mod types { pub type blkcnt_t = i32; #[repr(C)] - #[deriving(Copy)] pub struct stat { + #[derive(Copy)] pub struct stat { pub st_dev: dev_t, pub st_mode: mode_t, pub st_nlink: nlink_t, @@ -1903,13 +1903,13 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time_t, pub modtime: time_t, } #[repr(C)] - #[deriving(Copy)] pub struct pthread_attr_t { + #[derive(Copy)] pub struct pthread_attr_t { pub __sig: c_long, pub __opaque: [c_char; 36] } @@ -1920,7 +1920,7 @@ pub mod types { } pub mod extra { #[repr(C)] - #[deriving(Copy)] pub struct mach_timebase_info { + #[derive(Copy)] pub struct mach_timebase_info { pub numer: u32, pub denom: u32, } @@ -1981,7 +1981,7 @@ pub mod types { pub type blkcnt_t = i32; #[repr(C)] - #[deriving(Copy)] pub struct stat { + #[derive(Copy)] pub struct stat { pub st_dev: dev_t, pub st_mode: mode_t, pub st_nlink: nlink_t, @@ -2007,13 +2007,13 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time_t, pub modtime: time_t, } #[repr(C)] - #[deriving(Copy)] pub struct pthread_attr_t { + #[derive(Copy)] pub struct pthread_attr_t { pub __sig: c_long, pub __opaque: [c_char; 56] } @@ -2024,7 +2024,7 @@ pub mod types { } pub mod extra { #[repr(C)] - #[deriving(Copy)] pub struct mach_timebase_info { + #[derive(Copy)] pub struct mach_timebase_info { pub numer: u32, pub denom: u32, } diff --git a/src/liblog/directive.rs b/src/liblog/directive.rs index 7e21f5f48f163..8134503019c99 100644 --- a/src/liblog/directive.rs +++ b/src/liblog/directive.rs @@ -12,7 +12,7 @@ use regex::Regex; use std::ascii::AsciiExt; use std::cmp; -#[deriving(Show, Clone)] +#[derive(Show, Clone)] pub struct LogDirective { pub name: Option, pub level: u32, diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index b30938ae7f577..e93d83ed1a922 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -232,7 +232,7 @@ struct DefaultLogger { } /// Wraps the log level with fmt implementations. -#[deriving(Copy, PartialEq, PartialOrd)] +#[derive(Copy, PartialEq, PartialOrd)] pub struct LogLevel(pub u32); impl fmt::Show for LogLevel { @@ -319,7 +319,7 @@ pub fn set_logger(logger: Box) -> Option> { /// A LogRecord is created by the logging macros, and passed as the only /// argument to Loggers. -#[deriving(Show)] +#[derive(Show)] pub struct LogRecord<'a> { /// The module path of where the LogRecord originated. @@ -339,7 +339,7 @@ pub struct LogRecord<'a> { } #[doc(hidden)] -#[deriving(Copy)] +#[derive(Copy)] pub struct LogLocation { pub module_path: &'static str, pub file: &'static str, diff --git a/src/librand/chacha.rs b/src/librand/chacha.rs index 49577cd279bf8..ffebf3d99b8fb 100644 --- a/src/librand/chacha.rs +++ b/src/librand/chacha.rs @@ -29,7 +29,7 @@ const CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of /// [1]: D. J. Bernstein, [*ChaCha, a variant of /// Salsa20*](http://cr.yp.to/chacha.html) -#[deriving(Copy)] +#[derive(Copy)] pub struct ChaChaRng { buffer: [u32; STATE_WORDS], // Internal buffer of output state: [u32; STATE_WORDS], // Initial state diff --git a/src/librand/distributions/exponential.rs b/src/librand/distributions/exponential.rs index f31f3468a4c00..0fd9eff201bea 100644 --- a/src/librand/distributions/exponential.rs +++ b/src/librand/distributions/exponential.rs @@ -29,7 +29,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample}; /// Generate Normal Random /// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield /// College, Oxford -#[deriving(Copy)] +#[derive(Copy)] pub struct Exp1(pub f64); // This could be done via `-rng.gen::().ln()` but that is slower. @@ -67,7 +67,7 @@ impl Rand for Exp1 { /// let v = exp.ind_sample(&mut rand::thread_rng()); /// println!("{} is from a Exp(2) distribution", v); /// ``` -#[deriving(Copy)] +#[derive(Copy)] pub struct Exp { /// `lambda` stored as `1/lambda`, since this is what we scale by. lambda_inverse: f64 diff --git a/src/librand/distributions/mod.rs b/src/librand/distributions/mod.rs index 54cb8ae190718..dd1dd677b9df7 100644 --- a/src/librand/distributions/mod.rs +++ b/src/librand/distributions/mod.rs @@ -263,7 +263,7 @@ mod tests { use {Rng, Rand}; use super::{RandSample, WeightedChoice, Weighted, Sample, IndependentSample}; - #[deriving(PartialEq, Show)] + #[derive(PartialEq, Show)] struct ConstRand(uint); impl Rand for ConstRand { fn rand(_: &mut R) -> ConstRand { diff --git a/src/librand/distributions/normal.rs b/src/librand/distributions/normal.rs index 3507282ec486a..a1b05785055fd 100644 --- a/src/librand/distributions/normal.rs +++ b/src/librand/distributions/normal.rs @@ -28,7 +28,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample}; /// Generate Normal Random /// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield /// College, Oxford -#[deriving(Copy)] +#[derive(Copy)] pub struct StandardNormal(pub f64); impl Rand for StandardNormal { @@ -84,7 +84,7 @@ impl Rand for StandardNormal { /// let v = normal.ind_sample(&mut rand::thread_rng()); /// println!("{} is from a N(2, 9) distribution", v) /// ``` -#[deriving(Copy)] +#[derive(Copy)] pub struct Normal { mean: f64, std_dev: f64, @@ -132,7 +132,7 @@ impl IndependentSample for Normal { /// let v = log_normal.ind_sample(&mut rand::thread_rng()); /// println!("{} is from an ln N(2, 9) distribution", v) /// ``` -#[deriving(Copy)] +#[derive(Copy)] pub struct LogNormal { norm: Normal } diff --git a/src/librand/isaac.rs b/src/librand/isaac.rs index 1fe435a59adcb..20959095e3f09 100644 --- a/src/librand/isaac.rs +++ b/src/librand/isaac.rs @@ -29,7 +29,7 @@ const RAND_SIZE_UINT: uint = 1 << (RAND_SIZE_LEN as uint); /// /// [1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number /// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html) -#[deriving(Copy)] +#[derive(Copy)] pub struct IsaacRng { cnt: u32, rsl: [u32; RAND_SIZE_UINT], @@ -264,7 +264,7 @@ const RAND_SIZE_64: uint = 1 << RAND_SIZE_64_LEN; /// /// [1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number /// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html) -#[deriving(Copy)] +#[derive(Copy)] pub struct Isaac64Rng { cnt: uint, rsl: [u64; RAND_SIZE_64], diff --git a/src/librand/reseeding.rs b/src/librand/reseeding.rs index 94a11c040e497..896ce86c8bfc4 100644 --- a/src/librand/reseeding.rs +++ b/src/librand/reseeding.rs @@ -133,7 +133,7 @@ pub trait Reseeder { /// Reseed an RNG using a `Default` instance. This reseeds by /// replacing the RNG with the result of a `Default::default` call. -#[deriving(Copy)] +#[derive(Copy)] pub struct ReseedWithDefault; impl Reseeder for ReseedWithDefault { diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs index 5bfe7e15a9307..31fb504ba3d01 100644 --- a/src/librbml/lib.rs +++ b/src/librbml/lib.rs @@ -41,7 +41,7 @@ use std::str; pub mod io; /// Common data structures -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct Doc<'a> { pub data: &'a [u8], pub start: uint, @@ -71,7 +71,7 @@ pub struct TaggedDoc<'a> { pub doc: Doc<'a>, } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum EbmlEncoderTag { EsUint, // 0 EsU64, // 1 @@ -105,7 +105,7 @@ pub enum EbmlEncoderTag { EsLabel, // Used only when debugging } -#[deriving(Show)] +#[derive(Show)] pub enum Error { IntTooBig(uint), Expected(String), @@ -147,7 +147,7 @@ pub mod reader { ) } - #[deriving(Copy)] + #[derive(Copy)] pub struct Res { pub val: uint, pub next: uint diff --git a/src/libregex/compile.rs b/src/libregex/compile.rs index 1476e6ab8a706..d29a7a425c116 100644 --- a/src/libregex/compile.rs +++ b/src/libregex/compile.rs @@ -25,7 +25,7 @@ use parse::{ type InstIdx = uint; -#[deriving(Show, Clone)] +#[derive(Show, Clone)] pub enum Inst { // When a Match instruction is executed, the current thread is successful. Match, @@ -78,7 +78,7 @@ pub enum Inst { /// All of the data in a compiled expression is wrapped in "MaybeStatic" or /// "MaybeOwned" types so that a `Program` can be represented as static data. /// (This makes it convenient and efficient for use with the `regex!` macro.) -#[deriving(Clone)] +#[derive(Clone)] pub struct Program { /// A sequence of instructions. pub insts: Vec, diff --git a/src/libregex/parse.rs b/src/libregex/parse.rs index 692a065299ca2..07da86afcc971 100644 --- a/src/libregex/parse.rs +++ b/src/libregex/parse.rs @@ -52,7 +52,7 @@ impl fmt::Show for Error { /// /// Note that this representation prevents one from reproducing the regex as /// it was typed. (But it could be used to reproduce an equivalent regex.) -#[deriving(Show, Clone)] +#[derive(Show, Clone)] pub enum Ast { Nothing, Literal(char, Flags), @@ -69,14 +69,14 @@ pub enum Ast { Rep(Box, Repeater, Greed), } -#[deriving(Show, PartialEq, Clone)] +#[derive(Show, PartialEq, Clone)] pub enum Repeater { ZeroOne, ZeroMore, OneMore, } -#[deriving(Copy, Show, Clone)] +#[derive(Copy, Show, Clone)] pub enum Greed { Greedy, Ungreedy, @@ -103,7 +103,7 @@ impl Greed { /// constructing an abstract syntax tree. Its central purpose is to facilitate /// parsing groups and alternations while also maintaining a stack of flag /// state. -#[deriving(Show)] +#[derive(Show)] enum BuildAst { Expr(Ast), Paren(Flags, uint, String), // '(' diff --git a/src/libregex/re.rs b/src/libregex/re.rs index 51c234631550c..a95a0d8e4252a 100644 --- a/src/libregex/re.rs +++ b/src/libregex/re.rs @@ -103,7 +103,7 @@ pub fn is_match(regex: &str, text: &str) -> Result { /// makes it much faster when searching text. /// More details about the `regex!` macro can be found in the `regex` crate /// documentation. -#[deriving(Clone)] +#[derive(Clone)] pub enum Regex { // The representation of `Regex` is exported to support the `regex!` // syntax extension. Do not rely on it. @@ -116,7 +116,7 @@ pub enum Regex { Native(ExNative), } -#[deriving(Clone)] +#[derive(Clone)] #[doc(hidden)] pub struct ExDynamic { original: String, @@ -126,7 +126,7 @@ pub struct ExDynamic { } #[doc(hidden)] -#[deriving(Copy)] +#[derive(Copy)] pub struct ExNative { #[doc(hidden)] pub original: &'static str, @@ -539,7 +539,7 @@ impl Regex { } -#[deriving(Clone)] +#[derive(Clone)] pub enum NamesIter<'a> { NamesIterNative(::std::slice::Iter<'a, Option<&'static str>>), NamesIterDynamic(::std::slice::Iter<'a, Option>) @@ -596,7 +596,7 @@ impl Replacer for F where F: FnMut(&Captures) -> String { /// /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime /// of the string being split. -#[deriving(Clone)] +#[derive(Clone)] pub struct RegexSplits<'r, 't> { finder: FindMatches<'r, 't>, last: uint, @@ -630,7 +630,7 @@ impl<'r, 't> Iterator<&'t str> for RegexSplits<'r, 't> { /// /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime /// of the string being split. -#[deriving(Clone)] +#[derive(Clone)] pub struct RegexSplitsN<'r, 't> { splits: RegexSplits<'r, 't>, cur: uint, @@ -794,7 +794,7 @@ impl<'t> Captures<'t> { /// expression. /// /// `'t` is the lifetime of the matched text. -#[deriving(Clone)] +#[derive(Clone)] pub struct SubCaptures<'t> { idx: uint, caps: &'t Captures<'t>, @@ -817,7 +817,7 @@ impl<'t> Iterator<&'t str> for SubCaptures<'t> { /// Positions are byte indices in terms of the original string matched. /// /// `'t` is the lifetime of the matched text. -#[deriving(Clone)] +#[derive(Clone)] pub struct SubCapturesPos<'t> { idx: uint, caps: &'t Captures<'t>, @@ -841,7 +841,7 @@ impl<'t> Iterator> for SubCapturesPos<'t> { /// /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime /// of the matched string. -#[deriving(Clone)] +#[derive(Clone)] pub struct FindCaptures<'r, 't> { re: &'r Regex, search: &'t str, @@ -884,7 +884,7 @@ impl<'r, 't> Iterator> for FindCaptures<'r, 't> { /// /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime /// of the matched string. -#[deriving(Clone)] +#[derive(Clone)] pub struct FindMatches<'r, 't> { re: &'r Regex, search: &'t str, diff --git a/src/libregex/vm.rs b/src/libregex/vm.rs index 72e0e559c805b..54bb08fddce82 100644 --- a/src/libregex/vm.rs +++ b/src/libregex/vm.rs @@ -51,7 +51,7 @@ use unicode::regex::PERLW; pub type CaptureLocs = Vec>; /// Indicates the type of match to be performed by the VM. -#[deriving(Copy)] +#[derive(Copy)] pub enum MatchKind { /// Only checks if a match exists or not. Does not return location. Exists, @@ -96,7 +96,7 @@ struct Nfa<'r, 't> { /// Indicates the next action to take after a single non-empty instruction /// is processed. -#[deriving(Copy)] +#[derive(Copy)] pub enum StepState { /// This is returned if and only if a Match instruction is reached and /// we only care about the existence of a match. It instructs the VM to diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 82aa40cb0ad79..5f718739d8651 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -56,7 +56,7 @@ declare_lint! { "suggest using `loop { }` instead of `while true { }`" } -#[deriving(Copy)] +#[derive(Copy)] pub struct WhileTrue; impl LintPass for WhileTrue { @@ -82,7 +82,7 @@ declare_lint! { "detects unnecessary type casts that can be removed" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedCasts; impl LintPass for UnusedCasts { @@ -124,7 +124,7 @@ declare_lint! { "shift exceeds the type's number of bits" } -#[deriving(Copy)] +#[derive(Copy)] pub struct TypeLimits { /// Id of the last visited negated expression negated_expr_id: ast::NodeId, @@ -441,7 +441,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ImproperCTypesVisitor<'a, 'tcx> { } } -#[deriving(Copy)] +#[derive(Copy)] pub struct ImproperCTypes; impl LintPass for ImproperCTypes { @@ -484,7 +484,7 @@ declare_lint! { "use of owned (Box type) heap memory" } -#[deriving(Copy)] +#[derive(Copy)] pub struct BoxPointers; impl BoxPointers { @@ -624,7 +624,7 @@ declare_lint! { "detects attributes that were not used by the compiler" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedAttributes; impl LintPass for UnusedAttributes { @@ -708,7 +708,7 @@ declare_lint! { "path statements with no effect" } -#[deriving(Copy)] +#[derive(Copy)] pub struct PathStatements; impl LintPass for PathStatements { @@ -742,7 +742,7 @@ declare_lint! { "unused result of an expression in a statement" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedResults; impl LintPass for UnusedResults { @@ -810,7 +810,7 @@ declare_lint! { "types, variants, traits and type parameters should have camel case names" } -#[deriving(Copy)] +#[derive(Copy)] pub struct NonCamelCaseTypes; impl NonCamelCaseTypes { @@ -883,7 +883,7 @@ impl LintPass for NonCamelCaseTypes { } } -#[deriving(PartialEq)] +#[derive(PartialEq)] enum MethodContext { TraitDefaultImpl, TraitImpl, @@ -933,7 +933,7 @@ declare_lint! { "methods, functions, lifetime parameters and modules should have snake case names" } -#[deriving(Copy)] +#[derive(Copy)] pub struct NonSnakeCase; impl NonSnakeCase { @@ -1046,7 +1046,7 @@ declare_lint! { "static constants should have uppercase identifiers" } -#[deriving(Copy)] +#[derive(Copy)] pub struct NonUpperCaseGlobals; impl LintPass for NonUpperCaseGlobals { @@ -1099,7 +1099,7 @@ declare_lint! { "`if`, `match`, `while` and `return` do not need parentheses" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedParens; impl UnusedParens { @@ -1193,7 +1193,7 @@ declare_lint! { "unnecessary braces around an imported item" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedImportBraces; impl LintPass for UnusedImportBraces { @@ -1232,7 +1232,7 @@ declare_lint! { "using `Struct { x: x }` instead of `Struct { x }`" } -#[deriving(Copy)] +#[derive(Copy)] pub struct NonShorthandFieldPatterns; impl LintPass for NonShorthandFieldPatterns { @@ -1265,7 +1265,7 @@ declare_lint! { "unnecessary use of an `unsafe` block" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedUnsafe; impl LintPass for UnusedUnsafe { @@ -1290,7 +1290,7 @@ declare_lint! { "usage of an `unsafe` block" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnsafeBlocks; impl LintPass for UnsafeBlocks { @@ -1314,7 +1314,7 @@ declare_lint! { "detect mut variables which don't need to be mutable" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedMut; impl UnusedMut { @@ -1383,7 +1383,7 @@ declare_lint! { "detects unnecessary allocations that can be eliminated" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedAllocation; impl LintPass for UnusedAllocation { @@ -1574,7 +1574,7 @@ impl LintPass for MissingDoc { } } -#[deriving(Copy)] +#[derive(Copy)] pub struct MissingCopyImplementations; impl LintPass for MissingCopyImplementations { @@ -1649,7 +1649,7 @@ declare_lint! { /// Checks for use of items with `#[deprecated]`, `#[experimental]` and /// `#[unstable]` attributes, or no stability attribute. -#[deriving(Copy)] +#[derive(Copy)] pub struct Stability; impl Stability { @@ -1860,7 +1860,7 @@ declare_lint!{ /// Does nothing as a lint pass, but registers some `Lint`s /// which are used by other parts of the compiler. -#[deriving(Copy)] +#[derive(Copy)] pub struct HardwiredLints; impl LintPass for HardwiredLints { diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs index 787e999eea9f1..461a67ba93793 100644 --- a/src/librustc/lint/mod.rs +++ b/src/librustc/lint/mod.rs @@ -42,7 +42,7 @@ use syntax::ast; pub use lint::context::{Context, LintStore, raw_emit_lint, check_crate, gather_attrs}; /// Specification of a single lint. -#[deriving(Copy)] +#[derive(Copy)] pub struct Lint { /// A string identifier for the lint. /// @@ -174,7 +174,7 @@ pub trait LintPass { pub type LintPassObject = Box; /// Identifies a lint known to the compiler. -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct LintId { // Identity is based on pointer equality of this field. lint: &'static Lint, @@ -210,7 +210,7 @@ impl LintId { } /// Setting for how to handle a lint. -#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord)] +#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord)] pub enum Level { Allow, Warn, Deny, Forbid } @@ -239,7 +239,7 @@ impl Level { } /// How a lint level was set. -#[deriving(Clone, Copy, PartialEq, Eq)] +#[derive(Clone, Copy, PartialEq, Eq)] pub enum LintSource { /// Lint is at the default level as declared /// in rustc or a plugin. diff --git a/src/librustc/metadata/common.rs b/src/librustc/metadata/common.rs index 2a58da8cb3be7..cc21243b81d8d 100644 --- a/src/librustc/metadata/common.rs +++ b/src/librustc/metadata/common.rs @@ -113,7 +113,7 @@ pub const tag_items_data_item_reexport_def_id: uint = 0x39; pub const tag_items_data_item_reexport_name: uint = 0x3a; // used to encode crate_ctxt side tables -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] #[repr(uint)] pub enum astencode_tag { // Reserves 0x40 -- 0x5f tag_ast = 0x40, @@ -219,7 +219,7 @@ pub const tag_items_data_item_stability: uint = 0x92; pub const tag_items_data_item_repr: uint = 0x93; -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct LinkMeta { pub crate_name: String, pub crate_hash: Svh, diff --git a/src/librustc/metadata/csearch.rs b/src/librustc/metadata/csearch.rs index 2b11b8517b0d8..1401a7d4a1a6e 100644 --- a/src/librustc/metadata/csearch.rs +++ b/src/librustc/metadata/csearch.rs @@ -32,7 +32,7 @@ use syntax::parse::token; use std::collections::hash_map::HashMap; -#[deriving(Copy)] +#[derive(Copy)] pub struct MethodInfo { pub name: ast::Name, pub def_id: ast::DefId, diff --git a/src/librustc/metadata/cstore.rs b/src/librustc/metadata/cstore.rs index d5247472c3447..2f4acaca4de4d 100644 --- a/src/librustc/metadata/cstore.rs +++ b/src/librustc/metadata/cstore.rs @@ -48,13 +48,13 @@ pub struct crate_metadata { pub span: Span, } -#[deriving(Copy, Show, PartialEq, Clone)] +#[derive(Copy, Show, PartialEq, Clone)] pub enum LinkagePreference { RequireDynamic, RequireStatic, } -#[deriving(Copy, Clone, PartialEq, FromPrimitive)] +#[derive(Copy, Clone, PartialEq, FromPrimitive)] pub enum NativeLibraryKind { NativeStatic, // native static library (.a archive) NativeFramework, // OSX-specific @@ -63,7 +63,7 @@ pub enum NativeLibraryKind { // Where a crate came from on the local filesystem. One of these two options // must be non-None. -#[deriving(PartialEq, Clone)] +#[derive(PartialEq, Clone)] pub struct CrateSource { pub dylib: Option, pub rlib: Option, diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index d079d0e52aafa..395e403effb16 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -109,7 +109,7 @@ fn lookup_item<'a>(item_id: ast::NodeId, data: &'a [u8]) -> rbml::Doc<'a> { find_item(item_id, items) } -#[deriving(PartialEq)] +#[derive(PartialEq)] enum Family { ImmStatic, // c MutStatic, // b @@ -463,7 +463,7 @@ pub fn get_symbol(data: &[u8], id: ast::NodeId) -> String { } // Something that a name can resolve to. -#[deriving(Copy, Clone, Show)] +#[derive(Copy, Clone, Show)] pub enum DefLike { DlDef(def::Def), DlImpl(ast::DefId), @@ -1165,7 +1165,7 @@ pub fn get_crate_attributes(data: &[u8]) -> Vec { get_attributes(rbml::Doc::new(data)) } -#[deriving(Clone)] +#[derive(Clone)] pub struct CrateDep { pub cnum: ast::CrateNum, pub name: String, diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index 8378c620c1d19..a21cd2d2254c9 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -98,7 +98,7 @@ pub fn encode_def_id(rbml_w: &mut Encoder, id: DefId) { rbml_w.wr_tagged_str(tag_def_id, def_to_string(id)[]); } -#[deriving(Clone)] +#[derive(Clone)] struct entry { val: T, pos: u64 diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index 82071931fe3a6..29625d0a6afac 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -20,7 +20,7 @@ use std::os; use util::fs as myfs; use session::search_paths::{SearchPaths, PathKind}; -#[deriving(Copy)] +#[derive(Copy)] pub enum FileMatch { FileMatches, FileDoesntMatch, diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs index 88c7ccf1b1e36..9b96a3faeb656 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -44,7 +44,7 @@ use syntax::parse::token; // def-id will depend on where it originated from. Therefore, the conversion // function is given an indicator of the source of the def-id. See // astencode.rs for more information. -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum DefIdSource { // Identifies a struct, trait, enum, etc. NominalType, diff --git a/src/librustc/middle/cfg/construct.rs b/src/librustc/middle/cfg/construct.rs index 92aa70548c82b..3c75bfa5be65a 100644 --- a/src/librustc/middle/cfg/construct.rs +++ b/src/librustc/middle/cfg/construct.rs @@ -26,7 +26,7 @@ struct CFGBuilder<'a, 'tcx: 'a> { loop_scopes: Vec, } -#[deriving(Copy)] +#[derive(Copy)] struct LoopScope { loop_id: ast::NodeId, // id of loop/while node continue_index: CFGIndex, // where to go on a `loop` diff --git a/src/librustc/middle/cfg/mod.rs b/src/librustc/middle/cfg/mod.rs index e1c5906f0fb83..0ca146a295e13 100644 --- a/src/librustc/middle/cfg/mod.rs +++ b/src/librustc/middle/cfg/mod.rs @@ -26,7 +26,7 @@ pub struct CFG { pub exit: CFGIndex, } -#[deriving(Copy)] +#[derive(Copy)] pub struct CFGNodeData { pub id: ast::NodeId } diff --git a/src/librustc/middle/check_loop.rs b/src/librustc/middle/check_loop.rs index 5a08d7c179d1c..e68a9fb50efd0 100644 --- a/src/librustc/middle/check_loop.rs +++ b/src/librustc/middle/check_loop.rs @@ -16,12 +16,12 @@ use syntax::codemap::Span; use syntax::visit::Visitor; use syntax::visit; -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] enum Context { Normal, Loop, Closure } -#[deriving(Copy)] +#[derive(Copy)] struct CheckLoopVisitor<'a> { sess: &'a Session, cx: Context diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 4c5d76a2c40e5..fa670dd2066ac 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -103,7 +103,7 @@ pub struct MatchCheckCtxt<'a, 'tcx: 'a> { pub param_env: ParameterEnvironment<'tcx>, } -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub enum Constructor { /// The constructor of all patterns that don't vary by constructor, /// e.g. struct patterns and fixed-length arrays. @@ -120,14 +120,14 @@ pub enum Constructor { SliceWithSubslice(uint, uint) } -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] enum Usefulness { Useful, UsefulWithWitness(Vec>), NotUseful } -#[deriving(Copy)] +#[derive(Copy)] enum WitnessPreference { ConstructWitness, LeaveOutWitness diff --git a/src/librustc/middle/check_static.rs b/src/librustc/middle/check_static.rs index fb20df020acf8..aa789dc46cb4c 100644 --- a/src/librustc/middle/check_static.rs +++ b/src/librustc/middle/check_static.rs @@ -39,7 +39,7 @@ use syntax::visit::Visitor; use syntax::codemap::Span; use syntax::visit; -#[deriving(Copy, Eq, PartialEq)] +#[derive(Copy, Eq, PartialEq)] enum Mode { InConstant, InStatic, diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index 5b89912dd03fc..c2dc60795d0ab 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -62,7 +62,7 @@ use std::collections::hash_map::Entry::Vacant; // - Non-constants: everything else. // -#[deriving(Copy)] +#[derive(Copy)] pub enum constness { integral_const, general_const, @@ -294,7 +294,7 @@ pub fn process_crate(tcx: &ty::ctxt) { // FIXME (#33): this doesn't handle big integer/float literals correctly // (nor does the rest of our literal handling). -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub enum const_val { const_float(f64), const_int(i64), diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index 6cf6065de19f0..e78b8047f6958 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -28,13 +28,13 @@ use syntax::visit; use syntax::print::{pp, pprust}; use util::nodemap::NodeMap; -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum EntryOrExit { Entry, Exit, } -#[deriving(Clone)] +#[derive(Clone)] pub struct DataFlowContext<'a, 'tcx: 'a, O> { tcx: &'a ty::ctxt<'tcx>, diff --git a/src/librustc/middle/def.rs b/src/librustc/middle/def.rs index ff1ee39496626..230bcb93dd93c 100644 --- a/src/librustc/middle/def.rs +++ b/src/librustc/middle/def.rs @@ -20,7 +20,7 @@ use syntax::ast_util::local_def; use std::cell::RefCell; -#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Def { DefFn(ast::DefId, bool /* is_ctor */), DefStaticMethod(/* method */ ast::DefId, MethodProvenance), @@ -68,19 +68,19 @@ pub type DefMap = RefCell>; // within. pub type ExportMap = NodeMap>; -#[deriving(Copy)] +#[derive(Copy)] pub struct Export { pub name: ast::Name, // The name of the target. pub def_id: ast::DefId, // The definition of the target. } -#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum MethodProvenance { FromTrait(ast::DefId), FromImpl(ast::DefId), } -#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum TyParamProvenance { FromSelf(ast::DefId), FromParam(ast::DefId), @@ -106,7 +106,7 @@ impl TyParamProvenance { } } -#[deriving(Clone, Copy, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub enum TraitItemKind { NonstaticMethodTraitItemKind, StaticMethodTraitItemKind, diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index 52899aaba412f..f5db9e5957ee2 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -23,7 +23,7 @@ use syntax::codemap::Span; use syntax::visit; use syntax::visit::Visitor; -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] enum UnsafeContext { SafeContext, UnsafeFn, diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index d36c85342ce32..29ed4fd78e618 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -95,7 +95,7 @@ pub trait Delegate<'tcx> { mode: MutateMode); } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum LoanCause { ClosureCapture(Span), AddrOf, @@ -107,20 +107,20 @@ pub enum LoanCause { MatchDiscriminant } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum ConsumeMode { Copy, // reference to x where x has a type that copies Move(MoveReason), // reference to x where x has a type that moves } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum MoveReason { DirectRefMove, PatBindingMove, CaptureMove, } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum MatchMode { NonBindingMatch, BorrowingMatch, @@ -128,7 +128,7 @@ pub enum MatchMode { MovingMatch, } -#[deriving(PartialEq,Show)] +#[derive(PartialEq,Show)] enum TrackMatchMode { Unknown, Definite(MatchMode), @@ -197,14 +197,14 @@ impl TrackMatchMode { } } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum MutateMode { Init, JustWrite, // x = y WriteAndRead, // x += y } -#[deriving(Copy)] +#[derive(Copy)] enum OverloadedCallType { FnOverloadedCall, FnMutOverloadedCall, diff --git a/src/librustc/middle/fast_reject.rs b/src/librustc/middle/fast_reject.rs index dcbd94b8482fd..9a12ce11745bc 100644 --- a/src/librustc/middle/fast_reject.rs +++ b/src/librustc/middle/fast_reject.rs @@ -14,7 +14,7 @@ use syntax::ast; use self::SimplifiedType::*; /// See `simplify_type -#[deriving(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, PartialEq, Eq, Hash)] pub enum SimplifiedType { BoolSimplifiedType, CharSimplifiedType, diff --git a/src/librustc/middle/graph.rs b/src/librustc/middle/graph.rs index da00d737b473e..96829196f1897 100644 --- a/src/librustc/middle/graph.rs +++ b/src/librustc/middle/graph.rs @@ -61,18 +61,18 @@ impl Show for Edge { } } -#[deriving(Clone, Copy, PartialEq, Show)] +#[derive(Clone, Copy, PartialEq, Show)] pub struct NodeIndex(pub uint); #[allow(non_upper_case_globals)] pub const InvalidNodeIndex: NodeIndex = NodeIndex(uint::MAX); -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub struct EdgeIndex(pub uint); #[allow(non_upper_case_globals)] pub const InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX); // Use a private field here to guarantee no more instances are created: -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub struct Direction { repr: uint } #[allow(non_upper_case_globals)] pub const Outgoing: Direction = Direction { repr: 0 }; diff --git a/src/librustc/middle/infer/combine.rs b/src/librustc/middle/infer/combine.rs index e0bcdfc6d8d93..efd287f2a215d 100644 --- a/src/librustc/middle/infer/combine.rs +++ b/src/librustc/middle/infer/combine.rs @@ -447,7 +447,7 @@ impl<'tcx> Combineable<'tcx> for ty::FnSig<'tcx> { } } -#[deriving(Clone)] +#[derive(Clone)] pub struct CombineFields<'a, 'tcx: 'a> { pub infcx: &'a InferCtxt<'a, 'tcx>, pub a_is_expected: bool, diff --git a/src/librustc/middle/infer/mod.rs b/src/librustc/middle/infer/mod.rs index d9b7e04bc7941..f490f9edd63cb 100644 --- a/src/librustc/middle/infer/mod.rs +++ b/src/librustc/middle/infer/mod.rs @@ -97,7 +97,7 @@ pub type SkolemizationMap = FnvHashMap; /// Why did we require that the two types be related? /// /// See `error_reporting.rs` for more details -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub enum TypeOrigin { // Not yet categorized in a better way Misc(Span), @@ -135,7 +135,7 @@ pub enum TypeOrigin { } /// See `error_reporting.rs` for more details -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub enum ValuePairs<'tcx> { Types(ty::expected_found>), TraitRefs(ty::expected_found>>), @@ -146,7 +146,7 @@ pub enum ValuePairs<'tcx> { /// encounter an error or subtyping constraint. /// /// See `error_reporting.rs` for more details. -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct TypeTrace<'tcx> { origin: TypeOrigin, values: ValuePairs<'tcx>, @@ -155,7 +155,7 @@ pub struct TypeTrace<'tcx> { /// The origin of a `r1 <= r2` constraint. /// /// See `error_reporting.rs` for more details -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub enum SubregionOrigin<'tcx> { // Arose from a subtyping relation Subtype(TypeTrace<'tcx>), @@ -224,7 +224,7 @@ pub enum SubregionOrigin<'tcx> { } /// Times when we replace late-bound regions with variables: -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub enum LateBoundRegionConversionTime { /// when a fn is called FnCall, @@ -239,7 +239,7 @@ pub enum LateBoundRegionConversionTime { /// Reasons to create a region inference variable /// /// See `error_reporting.rs` for more details -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub enum RegionVariableOrigin<'tcx> { // Region variables created for ill-categorized reasons, // mostly indicates places in need of refactoring @@ -272,7 +272,7 @@ pub enum RegionVariableOrigin<'tcx> { BoundRegionInCoherence(ast::Name), } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum fixup_err { unresolved_int_ty(IntVid), unresolved_float_ty(FloatVid), diff --git a/src/librustc/middle/infer/region_inference/graphviz.rs b/src/librustc/middle/infer/region_inference/graphviz.rs index 8455ee3955bd0..8cecade15c695 100644 --- a/src/librustc/middle/infer/region_inference/graphviz.rs +++ b/src/librustc/middle/infer/region_inference/graphviz.rs @@ -121,7 +121,7 @@ struct ConstraintGraph<'a, 'tcx: 'a> { node_ids: FnvHashMap, } -#[deriving(Clone, Hash, PartialEq, Eq, Show)] +#[derive(Clone, Hash, PartialEq, Eq, Show)] enum Node { RegionVid(ty::RegionVid), Region(ty::Region), diff --git a/src/librustc/middle/infer/region_inference/mod.rs b/src/librustc/middle/infer/region_inference/mod.rs index 7372bb267b06c..1bb8ef8e55d7d 100644 --- a/src/librustc/middle/infer/region_inference/mod.rs +++ b/src/librustc/middle/infer/region_inference/mod.rs @@ -41,7 +41,7 @@ mod doc; mod graphviz; // A constraint that influences the inference process. -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub enum Constraint { // One region variable is subregion of another ConstrainVarSubVar(RegionVid, RegionVid), @@ -68,13 +68,13 @@ pub enum Verify<'tcx> { VerifyParamBound(ty::ParamTy, SubregionOrigin<'tcx>, Region, Vec), } -#[deriving(Copy, PartialEq, Eq, Hash)] +#[derive(Copy, PartialEq, Eq, Hash)] pub struct TwoRegions { a: Region, b: Region, } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum UndoLogEntry { OpenSnapshot, CommitedSnapshot, @@ -85,12 +85,12 @@ pub enum UndoLogEntry { AddCombination(CombineMapType, TwoRegions) } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum CombineMapType { Lub, Glb } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub enum RegionResolutionError<'tcx> { /// `ConcreteFailure(o, a, b)`: /// @@ -142,7 +142,7 @@ pub enum RegionResolutionError<'tcx> { /// ``` /// would report an error because we expect 'a and 'b to match, and so we group /// 'a and 'b together inside a SameRegions struct -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct SameRegions { pub scope_id: ast::NodeId, pub regions: Vec @@ -216,7 +216,7 @@ pub struct RegionVarBindings<'a, 'tcx: 'a> { values: RefCell>>, } -#[deriving(Show)] +#[derive(Show)] #[allow(missing_copy_implementations)] pub struct RegionSnapshot { length: uint, @@ -936,10 +936,10 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { // ______________________________________________________________________ -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] enum Classification { Expanding, Contracting } -#[deriving(Copy)] +#[derive(Copy)] pub enum VarValue { NoValue, Value(Region), ErrorValue } struct VarData { diff --git a/src/librustc/middle/infer/type_variable.rs b/src/librustc/middle/infer/type_variable.rs index 49a1e6f926312..b36a285ed7a3a 100644 --- a/src/librustc/middle/infer/type_variable.rs +++ b/src/librustc/middle/infer/type_variable.rs @@ -46,7 +46,7 @@ struct Delegate; type Relation = (RelationDir, ty::TyVid); -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum RelationDir { SubtypeOf, SupertypeOf, EqTo } diff --git a/src/librustc/middle/infer/unify.rs b/src/librustc/middle/infer/unify.rs index 3127ef5d8a5f5..6b0e6fd866bcb 100644 --- a/src/librustc/middle/infer/unify.rs +++ b/src/librustc/middle/infer/unify.rs @@ -62,7 +62,7 @@ pub trait UnifyValue<'tcx> : Clone + Repr<'tcx> + PartialEq { /// to keep the DAG relatively balanced, which helps keep the running /// time of the algorithm under control. For more information, see /// . -#[deriving(PartialEq,Clone)] +#[derive(PartialEq,Clone)] pub enum VarValue { Redirect(K), Root(V, uint), @@ -90,7 +90,7 @@ pub struct Node { pub rank: uint, } -#[deriving(Copy)] +#[derive(Copy)] pub struct Delegate; // We can't use V:LatticeValue, much as I would like to, diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index 2aef430719923..080d13f109212 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -45,7 +45,7 @@ macro_rules! lets_do_this { $( $variant:ident, $name:expr, $method:ident; )* ) => { -#[deriving(Copy, FromPrimitive, PartialEq, Eq, Hash)] +#[derive(Copy, FromPrimitive, PartialEq, Eq, Hash)] pub enum LangItem { $($variant),* } diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 0c3438abb2b47..20382efce5f9d 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -138,10 +138,10 @@ enum LoopKind<'a> { ForLoop(&'a ast::Pat), } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] struct Variable(uint); -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] struct LiveNode(uint); impl Variable { @@ -158,7 +158,7 @@ impl Clone for LiveNode { } } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] enum LiveNodeKind { FreeVarNode(Span), ExprNode(Span), @@ -244,13 +244,13 @@ struct CaptureInfo { var_nid: NodeId } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] struct LocalInfo { id: NodeId, ident: ast::Ident } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] enum VarKind { Arg(NodeId, ast::Ident), Local(LocalInfo), @@ -529,7 +529,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) { // Actually we compute just a bit more than just liveness, but we use // the same basic propagation framework in all cases. -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] struct Users { reader: LiveNode, writer: LiveNode, @@ -544,7 +544,7 @@ fn invalid_users() -> Users { } } -#[deriving(Copy)] +#[derive(Copy)] struct Specials { exit_ln: LiveNode, fallthrough_ln: LiveNode, diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 70942a950e324..1bb3bc8bafe5b 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -87,7 +87,7 @@ use syntax::parse::token; use std::cell::RefCell; use std::rc::Rc; -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub enum categorization<'tcx> { cat_rvalue(ty::Region), // temporary val, argument is its scope cat_static_item, @@ -101,7 +101,7 @@ pub enum categorization<'tcx> { } // Represents any kind of upvar -#[deriving(Clone, Copy, PartialEq, Show)] +#[derive(Clone, Copy, PartialEq, Show)] pub struct Upvar { pub id: ty::UpvarId, // Unboxed closure kinds are used even for old-style closures for simplicity @@ -111,7 +111,7 @@ pub struct Upvar { } // different kinds of pointers: -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub enum PointerKind { Unique, BorrowedPtr(ty::BorrowKind, ty::Region), @@ -121,25 +121,25 @@ pub enum PointerKind { // We use the term "interior" to mean "something reachable from the // base without a pointer dereference", e.g. a field -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub enum InteriorKind { InteriorField(FieldName), InteriorElement(ElementKind), } -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub enum FieldName { NamedField(ast::Name), PositionalField(uint) } -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub enum ElementKind { VecElement, OtherElement, } -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub enum MutabilityCategory { McImmutable, // Immutable. McDeclared, // Directly declared as mutable. @@ -151,7 +151,7 @@ pub enum MutabilityCategory { // Upvar categorization can generate a variable number of nested // derefs. The note allows detecting them without deep pattern // matching on the categorization. -#[deriving(Clone, Copy, PartialEq, Show)] +#[derive(Clone, Copy, PartialEq, Show)] pub enum Note { NoteClosureEnv(ty::UpvarId), // Deref through closure env NoteUpvarRef(ty::UpvarId), // Deref through by-ref upvar @@ -172,7 +172,7 @@ pub enum Note { // dereference, but its type is the type *before* the dereference // (`@T`). So use `cmt.ty` to find the type of the value in a consistent // fashion. For more details, see the method `cat_pattern` -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub struct cmt_<'tcx> { pub id: ast::NodeId, // id of expr/pat producing this value pub span: Span, // span of same expr/pat @@ -186,7 +186,7 @@ pub type cmt<'tcx> = Rc>; // We pun on *T to mean both actual deref of a ptr as well // as accessing of components: -#[deriving(Copy)] +#[derive(Copy)] pub enum deref_kind { deref_ptr(PointerKind), deref_interior(InteriorKind), @@ -1373,13 +1373,13 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> { } } -#[deriving(Copy)] +#[derive(Copy)] pub enum InteriorSafety { InteriorUnsafe, InteriorSafe } -#[deriving(Copy)] +#[derive(Copy)] pub enum AliasableReason { AliasableBorrowed, AliasableClosure(ast::NodeId), // Aliasable due to capture Fn closure env diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs index cfa0d419aa3f0..72e476553749b 100644 --- a/src/librustc/middle/privacy.rs +++ b/src/librustc/middle/privacy.rs @@ -49,7 +49,7 @@ pub type PublicItems = NodeSet; // FIXME: dox pub type LastPrivateMap = NodeMap; -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum LastPrivate { LastMod(PrivateDep), // `use` directives (imports) can refer to two separate definitions in the @@ -63,14 +63,14 @@ pub enum LastPrivate { type_used: ImportUse}, } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum PrivateDep { AllPublic, DependsOn(ast::DefId), } // How an import is used. -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum ImportUse { Unused, // The import is not used. Used, // The import is used. diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index be89b32cdaae6..3dbf5daf004f9 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -36,7 +36,7 @@ use syntax::visit::{Visitor, FnKind}; /// placate the same deriving in `ty::FreeRegion`, but we may want to /// actually attach a more meaningful ordering to scopes than the one /// generated via deriving here. -#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable, +#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable, RustcDecodable, Show, Copy)] pub enum CodeExtent { Misc(ast::NodeId) @@ -116,7 +116,7 @@ pub struct RegionMaps { terminating_scopes: RefCell>, } -#[deriving(Copy)] +#[derive(Copy)] pub struct Context { var_parent: Option, diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index e9504a92f7b46..48db2c9549fc1 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -33,7 +33,7 @@ use syntax::visit; use syntax::visit::Visitor; use util::nodemap::NodeMap; -#[deriving(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)] pub enum DefRegion { DefStaticRegion, DefEarlyBoundRegion(/* space */ subst::ParamSpace, diff --git a/src/librustc/middle/subst.rs b/src/librustc/middle/subst.rs index 3c5459ff3bc75..897d3cae89fb9 100644 --- a/src/librustc/middle/subst.rs +++ b/src/librustc/middle/subst.rs @@ -28,7 +28,7 @@ use syntax::codemap::{Span, DUMMY_SP}; /// identify each in-scope parameter by an *index* and a *parameter /// space* (which indices where the parameter is defined; see /// `ParamSpace`). -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct Substs<'tcx> { pub types: VecPerParamSpace>, pub regions: RegionSubsts, @@ -37,7 +37,7 @@ pub struct Substs<'tcx> { /// Represents the values to use when substituting lifetime parameters. /// If the value is `ErasedRegions`, then this subst is occurring during /// trans, and all region parameters will be replaced with `ty::ReStatic`. -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub enum RegionSubsts { ErasedRegions, NonerasedRegions(VecPerParamSpace) @@ -179,7 +179,7 @@ impl RegionSubsts { /////////////////////////////////////////////////////////////////////////// // ParamSpace -#[deriving(PartialOrd, Ord, PartialEq, Eq, Copy, +#[derive(PartialOrd, Ord, PartialEq, Eq, Copy, Clone, Hash, RustcEncodable, RustcDecodable, Show)] pub enum ParamSpace { TypeSpace, // Type parameters attached to a type definition, trait, or impl @@ -213,7 +213,7 @@ impl ParamSpace { /// Vector of things sorted by param space. Used to keep /// the set of things declared on the type, self, or method /// distinct. -#[deriving(PartialEq, Eq, Clone, Hash, RustcEncodable, RustcDecodable)] +#[derive(PartialEq, Eq, Clone, Hash, RustcEncodable, RustcDecodable)] pub struct VecPerParamSpace { // This was originally represented as a tuple with one Vec for // each variant of ParamSpace, and that remains the abstraction @@ -468,7 +468,7 @@ impl VecPerParamSpace { } } -#[deriving(Clone)] +#[derive(Clone)] pub struct EnumeratedItems<'a,T:'a> { vec: &'a VecPerParamSpace, space_index: uint, diff --git a/src/librustc/middle/traits/mod.rs b/src/librustc/middle/traits/mod.rs index b10dfa5b71813..7b06d2a5b104f 100644 --- a/src/librustc/middle/traits/mod.rs +++ b/src/librustc/middle/traits/mod.rs @@ -52,7 +52,7 @@ mod util; /// either identifying an `impl` (e.g., `impl Eq for int`) that /// provides the required vtable, or else finding a bound that is in /// scope. The eventual result is usually a `Selection` (defined below). -#[deriving(Clone)] +#[derive(Clone)] pub struct Obligation<'tcx, T> { pub cause: ObligationCause<'tcx>, pub recursion_depth: uint, @@ -63,7 +63,7 @@ pub type PredicateObligation<'tcx> = Obligation<'tcx, ty::Predicate<'tcx>>; pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>; /// Why did we incur this obligation? Used for error reporting. -#[deriving(Clone)] +#[derive(Clone)] pub struct ObligationCause<'tcx> { pub span: Span, @@ -78,7 +78,7 @@ pub struct ObligationCause<'tcx> { pub code: ObligationCauseCode<'tcx> } -#[deriving(Clone)] +#[derive(Clone)] pub enum ObligationCauseCode<'tcx> { /// Not well classified or should be obvious from span. MiscObligation, @@ -115,7 +115,7 @@ pub enum ObligationCauseCode<'tcx> { ImplDerivedObligation(DerivedObligationCause<'tcx>), } -#[deriving(Clone)] +#[derive(Clone)] pub struct DerivedObligationCause<'tcx> { /// The trait reference of the parent obligation that led to the /// current obligation. Note that only trait obligations lead to @@ -133,7 +133,7 @@ pub type TraitObligations<'tcx> = subst::VecPerParamSpace> pub type Selection<'tcx> = Vtable<'tcx, PredicateObligation<'tcx>>; -#[deriving(Clone,Show)] +#[derive(Clone,Show)] pub enum SelectionError<'tcx> { Unimplemented, Overflow, @@ -147,7 +147,7 @@ pub struct FulfillmentError<'tcx> { pub code: FulfillmentErrorCode<'tcx> } -#[deriving(Clone)] +#[derive(Clone)] pub enum FulfillmentErrorCode<'tcx> { CodeSelectionError(SelectionError<'tcx>), CodeProjectionError(MismatchedProjectionTypes<'tcx>), @@ -201,7 +201,7 @@ pub type SelectionResult<'tcx, T> = Result, SelectionError<'tcx>>; /// ### The type parameter `N` /// /// See explanation on `VtableImplData`. -#[deriving(Show,Clone)] +#[derive(Show,Clone)] pub enum Vtable<'tcx, N> { /// Vtable identifying a particular impl. VtableImpl(VtableImplData<'tcx, N>), @@ -233,14 +233,14 @@ pub enum Vtable<'tcx, N> { /// is `Obligation`, as one might expect. During trans, however, this /// is `()`, because trans only requires a shallow resolution of an /// impl, and nested obligations are satisfied later. -#[deriving(Clone)] +#[derive(Clone)] pub struct VtableImplData<'tcx, N> { pub impl_def_id: ast::DefId, pub substs: subst::Substs<'tcx>, pub nested: subst::VecPerParamSpace } -#[deriving(Show,Clone)] +#[derive(Show,Clone)] pub struct VtableBuiltinData { pub nested: subst::VecPerParamSpace } diff --git a/src/librustc/middle/traits/project.rs b/src/librustc/middle/traits/project.rs index c84f31bf6c3bc..b73db2bb91619 100644 --- a/src/librustc/middle/traits/project.rs +++ b/src/librustc/middle/traits/project.rs @@ -43,7 +43,7 @@ pub enum ProjectionTyError<'tcx> { TraitSelectionError(SelectionError<'tcx>), } -#[deriving(Clone)] +#[derive(Clone)] pub struct MismatchedProjectionTypes<'tcx> { pub err: ty::type_err<'tcx> } diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs index f9dced088f8c1..716303c4125e4 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -82,7 +82,7 @@ struct TraitObligationStack<'prev, 'tcx: 'prev> { previous: Option<&'prev TraitObligationStack<'prev, 'tcx>> } -#[deriving(Clone)] +#[derive(Clone)] pub struct SelectionCache<'tcx> { hashmap: RefCell>, SelectionResult<'tcx, SelectionCandidate<'tcx>>>>, @@ -94,7 +94,7 @@ pub enum MethodMatchResult { MethodDidNotMatch, } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum MethodMatchedData { // In the case of a precise match, we don't really need to store // how the match was found. So don't. @@ -129,7 +129,7 @@ pub enum MethodMatchedData { /// matching where clause. Part of the reason for this is that where /// clauses can give additional information (like, the types of output /// parameters) that would have to be inferred from the impl. -#[deriving(PartialEq,Eq,Show,Clone)] +#[derive(PartialEq,Eq,Show,Clone)] enum SelectionCandidate<'tcx> { BuiltinCandidate(ty::BuiltinBound), ParamCandidate(ty::PolyTraitRef<'tcx>), @@ -168,7 +168,7 @@ enum BuiltinBoundConditions<'tcx> { AmbiguousBuiltin } -#[deriving(Show)] +#[derive(Show)] enum EvaluationResult<'tcx> { EvaluatedToOk, EvaluatedToAmbig, diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 7bc5d3d070894..b82e4d47f1a39 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -107,13 +107,13 @@ pub struct CrateAnalysis<'tcx> { pub glob_map: Option, } -#[deriving(Copy, PartialEq, Eq, Hash)] +#[derive(Copy, PartialEq, Eq, Hash)] pub struct field<'tcx> { pub name: ast::Name, pub mt: mt<'tcx> } -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub enum ImplOrTraitItemContainer { TraitContainer(ast::DefId), ImplContainer(ast::DefId), @@ -128,7 +128,7 @@ impl ImplOrTraitItemContainer { } } -#[deriving(Clone)] +#[derive(Clone)] pub enum ImplOrTraitItem<'tcx> { MethodTraitItem(Rc>), TypeTraitItem(Rc), @@ -173,7 +173,7 @@ impl<'tcx> ImplOrTraitItem<'tcx> { } } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub enum ImplOrTraitItemId { MethodTraitItemId(ast::DefId), TypeTraitItemId(ast::DefId), @@ -188,7 +188,7 @@ impl ImplOrTraitItemId { } } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct Method<'tcx> { pub name: ast::Name, pub generics: ty::Generics<'tcx>, @@ -232,7 +232,7 @@ impl<'tcx> Method<'tcx> { } } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct AssociatedType { pub name: ast::Name, pub vis: ast::Visibility, @@ -240,13 +240,13 @@ pub struct AssociatedType { pub container: ImplOrTraitItemContainer, } -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub struct mt<'tcx> { pub ty: Ty<'tcx>, pub mutbl: ast::Mutability, } -#[deriving(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)] pub enum TraitStore { /// Box UniqTraitStore, @@ -254,7 +254,7 @@ pub enum TraitStore { RegionTraitStore(Region, ast::Mutability), } -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub struct field_ty { pub name: Name, pub id: DefId, @@ -264,26 +264,26 @@ pub struct field_ty { // Contains information needed to resolve types and (in the future) look up // the types of AST nodes. -#[deriving(Copy, PartialEq, Eq, Hash)] +#[derive(Copy, PartialEq, Eq, Hash)] pub struct creader_cache_key { pub cnum: CrateNum, pub pos: uint, pub len: uint } -#[deriving(Copy)] +#[derive(Copy)] pub enum ast_ty_to_ty_cache_entry<'tcx> { atttce_unresolved, /* not resolved yet */ atttce_resolved(Ty<'tcx>) /* resolved to a type, irrespective of region */ } -#[deriving(Clone, PartialEq, RustcDecodable, RustcEncodable)] +#[derive(Clone, PartialEq, RustcDecodable, RustcEncodable)] pub struct ItemVariances { pub types: VecPerParamSpace, pub regions: VecPerParamSpace, } -#[deriving(Clone, PartialEq, RustcDecodable, RustcEncodable, Show, Copy)] +#[derive(Clone, PartialEq, RustcDecodable, RustcEncodable, Show, Copy)] pub enum Variance { Covariant, // T <: T iff A <: B -- e.g., function return type Invariant, // T <: T iff B == A -- e.g., type of mutable cell @@ -291,14 +291,14 @@ pub enum Variance { Bivariant, // T <: T -- e.g., unused type parameter } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub enum AutoAdjustment<'tcx> { AdjustAddEnv(ast::DefId, ty::TraitStore), AdjustReifyFnPointer(ast::DefId), // go from a fn-item type to a fn-pointer type AdjustDerefRef(AutoDerefRef<'tcx>) } -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub enum UnsizeKind<'tcx> { // [T, ..n] -> [T], the uint field is n. UnsizeLength(uint), @@ -308,13 +308,13 @@ pub enum UnsizeKind<'tcx> { UnsizeVtable(TyTrait<'tcx>, /* the self type of the trait */ Ty<'tcx>) } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct AutoDerefRef<'tcx> { pub autoderefs: uint, pub autoref: Option> } -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub enum AutoRef<'tcx> { /// Convert from T to &T /// The third field allows us to wrap other AutoRef adjustments. @@ -431,13 +431,13 @@ pub fn type_of_adjust<'tcx>(cx: &ctxt<'tcx>, adj: &AutoAdjustment<'tcx>) -> Opti } } -#[deriving(Clone, Copy, RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Show)] +#[derive(Clone, Copy, RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Show)] pub struct param_index { pub space: subst::ParamSpace, pub index: uint } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub enum MethodOrigin<'tcx> { // fully statically resolved method MethodStatic(ast::DefId), @@ -455,7 +455,7 @@ pub enum MethodOrigin<'tcx> { // details for a method invoked with a receiver whose type is a type parameter // with a bounded trait. -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct MethodParam<'tcx> { // the precise trait reference that occurs as a bound -- this may // be a supertrait of what the user actually typed. Note that it @@ -468,7 +468,7 @@ pub struct MethodParam<'tcx> { } // details for a method invoked with a receiver whose type is an object -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct MethodObject<'tcx> { // the (super)trait containing the method to be invoked pub trait_ref: Rc>, @@ -486,7 +486,7 @@ pub struct MethodObject<'tcx> { pub real_index: uint, } -#[deriving(Clone)] +#[derive(Clone)] pub struct MethodCallee<'tcx> { pub origin: MethodOrigin<'tcx>, pub ty: Ty<'tcx>, @@ -505,13 +505,13 @@ pub struct MethodCallee<'tcx> { /// needed to add to the side tables. Thus to disambiguate /// we also keep track of whether there's an adjustment in /// our key. -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub struct MethodCall { pub expr_id: ast::NodeId, pub adjustment: ExprAdjustment } -#[deriving(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)] +#[derive(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)] pub enum ExprAdjustment { NoAdjustment, AutoDeref(uint), @@ -550,7 +550,7 @@ pub type vtable_param_res<'tcx> = Vec>; // Resolutions for bounds of all parameters, left to right, for a given path. pub type vtable_res<'tcx> = VecPerParamSpace>; -#[deriving(Clone)] +#[derive(Clone)] pub enum vtable_origin<'tcx> { /* Statically known vtable. def_id gives the impl item @@ -595,7 +595,7 @@ pub type ObjectCastMap<'tcx> = RefCell>>; /// will push one or more such restriction into the /// `transmute_restrictions` vector during `intrinsicck`. They are /// then checked during `trans` by the fn `check_intrinsics`. -#[deriving(Copy)] +#[derive(Copy)] pub struct TransmuteRestriction<'tcx> { /// The span whence the restriction comes. pub span: Span, @@ -854,7 +854,7 @@ macro_rules! sty_debug_print { // variable names. mod inner { use middle::ty; - #[deriving(Copy)] + #[derive(Copy)] struct DebugStat { total: uint, region_infer: uint, @@ -922,7 +922,7 @@ impl<'tcx> ctxt<'tcx> { } } -#[deriving(Show)] +#[derive(Show)] pub struct TyS<'tcx> { pub sty: sty<'tcx>, pub flags: TypeFlags, @@ -1028,14 +1028,14 @@ pub fn type_escapes_depth(ty: Ty, depth: u32) -> bool { ty.region_depth > depth } -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct BareFnTy<'tcx> { pub unsafety: ast::Unsafety, pub abi: abi::Abi, pub sig: PolyFnSig<'tcx>, } -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct ClosureTy<'tcx> { pub unsafety: ast::Unsafety, pub onceness: ast::Onceness, @@ -1045,7 +1045,7 @@ pub struct ClosureTy<'tcx> { pub abi: abi::Abi, } -#[deriving(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, PartialEq, Eq, Hash)] pub enum FnOutput<'tcx> { FnConverging(Ty<'tcx>), FnDiverging @@ -1066,7 +1066,7 @@ impl<'tcx> FnOutput<'tcx> { /// - `inputs` is the list of arguments and their modes. /// - `output` is the return type. /// - `variadic` indicates whether this is a varidic function. (only true for foreign fns) -#[deriving(Clone, PartialEq, Eq, Hash)] +#[derive(Clone, PartialEq, Eq, Hash)] pub struct FnSig<'tcx> { pub inputs: Vec>, pub output: FnOutput<'tcx>, @@ -1075,7 +1075,7 @@ pub struct FnSig<'tcx> { pub type PolyFnSig<'tcx> = Binder>; -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub struct ParamTy { pub space: subst::ParamSpace, pub idx: u32, @@ -1121,7 +1121,7 @@ pub struct ParamTy { /// is the outer fn. /// /// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index -#[deriving(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)] +#[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)] pub struct DebruijnIndex { // We maintain the invariant that this is never 0. So 1 indicates // the innermost binder. To ensure this, create with `DebruijnIndex::new`. @@ -1129,7 +1129,7 @@ pub struct DebruijnIndex { } /// Representation of regions: -#[deriving(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)] +#[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)] pub enum Region { // Region bound in a type or fn declaration which will be // substituted 'early' -- that is, at the same time when type @@ -1170,13 +1170,13 @@ pub enum Region { /// Upvars do not get their own node-id. Instead, we use the pair of /// the original var id (that is, the root variable that is referenced /// by the upvar) and the id of the closure expression. -#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)] pub struct UpvarId { pub var_id: ast::NodeId, pub closure_expr_id: ast::NodeId, } -#[deriving(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)] +#[derive(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)] pub enum BorrowKind { /// Data must be immutable and is aliasable. ImmBorrow, @@ -1269,7 +1269,7 @@ pub enum BorrowKind { /// - Through mutation, the borrowed upvars can actually escape /// the closure, so sometimes it is necessary for them to be larger /// than the closure lifetime itself. -#[deriving(PartialEq, Clone, RustcEncodable, RustcDecodable, Show, Copy)] +#[derive(PartialEq, Clone, RustcEncodable, RustcDecodable, Show, Copy)] pub struct UpvarBorrow { pub kind: BorrowKind, pub region: ty::Region, @@ -1294,7 +1294,7 @@ impl Region { } } -#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, +#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable, RustcDecodable, Show, Copy)] /// A "free" region `fr` can be interpreted as "some region /// at least as big as the scope `fr.scope`". @@ -1303,7 +1303,7 @@ pub struct FreeRegion { pub bound_region: BoundRegion } -#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, +#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable, RustcDecodable, Show, Copy)] pub enum BoundRegion { /// An anonymous region parameter for a given fn (&T) @@ -1325,7 +1325,7 @@ pub enum BoundRegion { // NB: If you change this, you'll probably want to change the corresponding // AST structure in libsyntax/ast.rs as well. -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub enum sty<'tcx> { ty_bool, ty_char, @@ -1373,7 +1373,7 @@ pub enum sty<'tcx> { // on non-useful type error messages) } -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct TyTrait<'tcx> { pub principal: ty::PolyTraitRef<'tcx>, pub bounds: ExistentialBounds<'tcx>, @@ -1445,7 +1445,7 @@ impl<'tcx> TyTrait<'tcx> { /// Note that a `TraitRef` introduces a level of region binding, to /// account for higher-ranked trait bounds like `T : for<'a> Foo<&'a /// U>` or higher-ranked object types. -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct TraitRef<'tcx> { pub def_id: DefId, pub substs: &'tcx Substs<'tcx>, @@ -1483,16 +1483,16 @@ impl<'tcx> PolyTraitRef<'tcx> { /// erase, or otherwise "discharge" these bound reons, we change the /// type from `Binder` to just `T` (see /// e.g. `liberate_late_bound_regions`). -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct Binder(pub T); -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum IntVarValue { IntType(ast::IntTy), UintType(ast::UintTy), } -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub enum terr_vstore_kind { terr_vec, terr_str, @@ -1500,14 +1500,14 @@ pub enum terr_vstore_kind { terr_trait } -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub struct expected_found { pub expected: T, pub found: T } // Data structures used in type unification -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub enum type_err<'tcx> { terr_mismatch, terr_unsafety_mismatch(expected_found), @@ -1544,7 +1544,7 @@ pub enum type_err<'tcx> { /// Bounds suitable for a named type parameter like `A` in `fn foo` /// as well as the existential type parameter in an object type. -#[deriving(PartialEq, Eq, Hash, Clone, Show)] +#[derive(PartialEq, Eq, Hash, Clone, Show)] pub struct ParamBounds<'tcx> { pub region_bounds: Vec, pub builtin_bounds: BuiltinBounds, @@ -1557,7 +1557,7 @@ pub struct ParamBounds<'tcx> { /// major difference between this case and `ParamBounds` is that /// general purpose trait bounds are omitted and there must be /// *exactly one* region. -#[deriving(PartialEq, Eq, Hash, Clone, Show)] +#[derive(PartialEq, Eq, Hash, Clone, Show)] pub struct ExistentialBounds<'tcx> { pub region_bound: ty::Region, pub builtin_bounds: BuiltinBounds, @@ -1566,7 +1566,7 @@ pub struct ExistentialBounds<'tcx> { pub type BuiltinBounds = EnumSet; -#[deriving(Clone, RustcEncodable, PartialEq, Eq, RustcDecodable, Hash, +#[derive(Clone, RustcEncodable, PartialEq, Eq, RustcDecodable, Hash, Show, Copy)] #[repr(uint)] pub enum BuiltinBound { @@ -1604,27 +1604,27 @@ impl CLike for BuiltinBound { } } -#[deriving(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, PartialEq, Eq, Hash)] pub struct TyVid { pub index: u32 } -#[deriving(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, PartialEq, Eq, Hash)] pub struct IntVid { pub index: u32 } -#[deriving(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, PartialEq, Eq, Hash)] pub struct FloatVid { pub index: u32 } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub struct RegionVid { pub index: u32 } -#[deriving(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, PartialEq, Eq, Hash)] pub enum InferTy { TyVar(TyVid), IntVar(IntVid), @@ -1641,7 +1641,7 @@ pub enum InferTy { FreshIntTy(u32), } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum UnconstrainedNumeric { UnconstrainedFloat, UnconstrainedInt, @@ -1649,7 +1649,7 @@ pub enum UnconstrainedNumeric { } -#[deriving(Clone, RustcEncodable, RustcDecodable, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, Eq, Hash, Show, Copy)] pub enum InferRegion { ReVar(RegionVid), ReSkolemized(u32, BoundRegion) @@ -1724,7 +1724,7 @@ impl fmt::Show for IntVarValue { } } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct TypeParameterDef<'tcx> { pub name: ast::Name, pub def_id: ast::DefId, @@ -1734,7 +1734,7 @@ pub struct TypeParameterDef<'tcx> { pub default: Option>, } -#[deriving(RustcEncodable, RustcDecodable, Clone, Show)] +#[derive(RustcEncodable, RustcDecodable, Clone, Show)] pub struct RegionParameterDef { pub name: ast::Name, pub def_id: ast::DefId, @@ -1751,7 +1751,7 @@ impl RegionParameterDef { /// Information about the formal type/lifetime parameters associated /// with an item or method. Analogous to ast::Generics. -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct Generics<'tcx> { pub types: VecPerParamSpace>, pub regions: VecPerParamSpace, @@ -1783,7 +1783,7 @@ impl<'tcx> Generics<'tcx> { } } -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub enum Predicate<'tcx> { /// Corresponds to `where Foo : Bar`. `Foo` here would be /// the `Self` type of the trait reference and `A`, `B`, and `C` @@ -1804,7 +1804,7 @@ pub enum Predicate<'tcx> { Projection(PolyProjectionPredicate<'tcx>), } -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct TraitPredicate<'tcx> { pub trait_ref: Rc> } @@ -1830,11 +1830,11 @@ impl<'tcx> PolyTraitPredicate<'tcx> { } } -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct EquatePredicate<'tcx>(pub Ty<'tcx>, pub Ty<'tcx>); // `0 == 1` pub type PolyEquatePredicate<'tcx> = ty::Binder>; -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct OutlivesPredicate(pub A, pub B); // `A : B` pub type PolyOutlivesPredicate = ty::Binder>; pub type PolyRegionOutlivesPredicate = PolyOutlivesPredicate; @@ -1852,7 +1852,7 @@ pub type PolyTypeOutlivesPredicate<'tcx> = PolyOutlivesPredicate, ty::R /// equality between arbitrary types. Processing an instance of Form /// #2 eventually yields one of these `ProjectionPredicate` /// instances to normalize the LHS. -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct ProjectionPredicate<'tcx> { pub projection_ty: ProjectionTy<'tcx>, pub ty: Ty<'tcx>, @@ -1868,7 +1868,7 @@ impl<'tcx> PolyProjectionPredicate<'tcx> { /// Represents the projection of an associated type. In explicit UFCS /// form this would be written `>::N`. -#[deriving(Clone, PartialEq, Eq, Hash, Show)] +#[derive(Clone, PartialEq, Eq, Hash, Show)] pub struct ProjectionTy<'tcx> { /// The trait reference `T as Trait<..>`. pub trait_ref: Rc>, @@ -2004,7 +2004,7 @@ impl<'tcx> Predicate<'tcx> { /// `[[], [U:Bar]]`. Now if there were some particular reference /// like `Foo`, then the `GenericBounds` would be `[[], /// [uint:Bar]]`. -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct GenericBounds<'tcx> { pub predicates: VecPerParamSpace>, } @@ -2053,7 +2053,7 @@ impl<'tcx> TraitRef<'tcx> { /// bound lifetime parameters are replaced with free ones, but in the /// future I hope to refine the representation of types so as to make /// more distinctions clearer. -#[deriving(Clone)] +#[derive(Clone)] pub struct ParameterEnvironment<'tcx> { /// A substitution that can be applied to move from /// the "outer" view of a type or method to the "inner" view. @@ -2199,7 +2199,7 @@ impl<'tcx> ParameterEnvironment<'tcx> { /// stray references in a comment or something). We try to reserve the /// "poly" prefix to refer to higher-ranked things, as in /// `PolyTraitRef`. -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct TypeScheme<'tcx> { pub generics: Generics<'tcx>, pub ty: Ty<'tcx> @@ -2228,13 +2228,13 @@ pub struct TraitDef<'tcx> { /// Records the substitutions used to translate the polytype for an /// item into the monotype of an item reference. -#[deriving(Clone)] +#[derive(Clone)] pub struct ItemSubsts<'tcx> { pub substs: Substs<'tcx>, } /// Records information about each unboxed closure. -#[deriving(Clone)] +#[derive(Clone)] pub struct UnboxedClosure<'tcx> { /// The type of the unboxed closure. pub closure_type: ClosureTy<'tcx>, @@ -2242,7 +2242,7 @@ pub struct UnboxedClosure<'tcx> { pub kind: UnboxedClosureKind, } -#[deriving(Clone, Copy, PartialEq, Eq, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Show)] pub enum UnboxedClosureKind { FnUnboxedClosureKind, FnMutUnboxedClosureKind, @@ -3103,7 +3103,7 @@ pub fn type_is_floating_point(ty: Ty) -> bool { /// The reason we compute type contents and not kinds is that it is /// easier for me (nmatsakis) to think about what is contained within /// a type than to think about what is *not* contained within a type. -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct TypeContents { pub bits: u64 } @@ -3696,7 +3696,7 @@ pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool { /// /// The ordering of the cases is significant. They are sorted so that cmp::max /// will keep the "more erroneous" of two values. -#[deriving(Copy, PartialOrd, Ord, Eq, PartialEq, Show)] +#[derive(Copy, PartialOrd, Ord, Eq, PartialEq, Show)] pub enum Representability { Representable, ContainsRecursive, @@ -4467,7 +4467,7 @@ pub fn expr_is_lval(tcx: &ctxt, e: &ast::Expr) -> bool { /// two kinds of rvalues is an artifact of trans which reflects how we will /// generate code for that kind of expression. See trans/expr.rs for more /// information. -#[deriving(Copy)] +#[derive(Copy)] pub enum ExprKind { LvalueExpr, RvalueDpsExpr, @@ -5052,7 +5052,7 @@ pub fn associated_type_parameter_index(cx: &ctxt, cx.sess.bug("couldn't find associated type parameter index") } -#[deriving(Copy, PartialEq, Eq)] +#[derive(Copy, PartialEq, Eq)] pub struct AssociatedTypeInfo { pub def_id: ast::DefId, pub index: uint, @@ -5147,7 +5147,7 @@ pub fn ty_to_def_id(ty: Ty) -> Option { } // Enum information -#[deriving(Clone)] +#[derive(Clone)] pub struct VariantInfo<'tcx> { pub args: Vec>, pub arg_names: Option>, @@ -5238,7 +5238,7 @@ pub fn item_path_str(cx: &ctxt, id: ast::DefId) -> String { with_path(cx, id, |path| ast_map::path_to_string(path)).to_string() } -#[deriving(Copy)] +#[derive(Copy)] pub enum DtorKind { NoDtor, TraitDtor(DefId, bool) @@ -5673,7 +5673,7 @@ pub fn tup_fields<'tcx>(v: &[Ty<'tcx>]) -> Vec> { }).collect() } -#[deriving(Copy, Clone)] +#[derive(Copy, Clone)] pub struct UnboxedClosureUpvar<'tcx> { pub def: def::Def, pub span: Span, @@ -6592,7 +6592,7 @@ impl<'tcx> UnboxedClosureTyper<'tcx> for ty::ctxt<'tcx> { /// The category of explicit self. -#[deriving(Clone, Copy, Eq, PartialEq, Show)] +#[derive(Clone, Copy, Eq, PartialEq, Show)] pub enum ExplicitSelfCategory { StaticExplicitSelfCategory, ByValueExplicitSelfCategory, @@ -6661,7 +6661,7 @@ pub fn accumulate_lifetimes_in_type(accumulator: &mut Vec, } /// A free variable referred to in a function. -#[deriving(Copy, RustcEncodable, RustcDecodable)] +#[derive(Copy, RustcEncodable, RustcDecodable)] pub struct Freevar { /// The variable being accessed free. pub def: def::Def, @@ -6938,7 +6938,7 @@ pub fn make_substs_for_receiver_types<'tcx>(tcx: &ty::ctxt<'tcx>, trait_ref.substs.clone().with_method(meth_tps, meth_regions) } -#[deriving(Copy)] +#[derive(Copy)] pub enum CopyImplementationError { FieldDoesNotImplementCopy(ast::Name), VariantDoesNotImplementCopy(ast::Name), diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 19ac6d466fb58..f3c997c4b57dc 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -46,7 +46,7 @@ pub struct Config { pub uint_type: UintTy, } -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum OptLevel { No, // -O0 Less, // -O1 @@ -54,14 +54,14 @@ pub enum OptLevel { Aggressive // -O3 } -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum DebugInfoLevel { NoDebugInfo, LimitedDebugInfo, FullDebugInfo, } -#[deriving(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)] +#[derive(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)] pub enum OutputType { OutputTypeBitcode, OutputTypeAssembly, @@ -71,7 +71,7 @@ pub enum OutputType { OutputTypeDepInfo, } -#[deriving(Clone)] +#[derive(Clone)] pub struct Options { // The crate config requested for the session, which may be combined // with additional crate configurations during the compile process @@ -113,7 +113,7 @@ pub struct Options { pub alt_std_name: Option } -#[deriving(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] #[allow(missing_copy_implementations)] pub enum PrintRequest { FileNames, @@ -137,7 +137,7 @@ impl Input { } } -#[deriving(Clone)] +#[derive(Clone)] pub struct OutputFilenames { pub out_directory: Path, pub out_filestem: String, @@ -222,14 +222,14 @@ pub fn basic_options() -> Options { // users can have their own entry // functions that don't start a // scheduler -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum EntryFnType { EntryMain, EntryStart, EntryNone, } -#[deriving(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash)] +#[derive(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash)] pub enum CrateType { CrateTypeExecutable, CrateTypeDylib, @@ -337,7 +337,7 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> { ] } -#[deriving(Clone)] +#[derive(Clone)] pub enum Passes { SomePasses(Vec), AllPasses, @@ -365,7 +365,7 @@ impl Passes { macro_rules! cgoptions { ($($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) => ( - #[deriving(Clone)] + #[derive(Clone)] pub struct CodegenOptions { $(pub $opt: $t),* } pub fn basic_codegen_options() -> CodegenOptions { @@ -673,10 +673,10 @@ pub fn optgroups() -> Vec { .collect() } -#[deriving(Copy, Clone, PartialEq, Eq, Show)] +#[derive(Copy, Clone, PartialEq, Eq, Show)] pub enum OptionStability { Stable, Unstable } -#[deriving(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq)] pub struct RustcOptGroup { pub opt_group: getopts::OptGroup, pub stability: OptionStability, diff --git a/src/librustc/session/search_paths.rs b/src/librustc/session/search_paths.rs index 8a6217a49f560..80970f2d0311a 100644 --- a/src/librustc/session/search_paths.rs +++ b/src/librustc/session/search_paths.rs @@ -10,7 +10,7 @@ use std::slice; -#[deriving(Clone)] +#[derive(Clone)] pub struct SearchPaths { paths: Vec<(PathKind, Path)>, } @@ -20,7 +20,7 @@ pub struct Iter<'a> { iter: slice::Iter<'a, (PathKind, Path)>, } -#[deriving(Eq, PartialEq, Clone, Copy)] +#[derive(Eq, PartialEq, Clone, Copy)] pub enum PathKind { Native, Crate, diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs index e1448364a9e05..7d2a8509cb510 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -23,7 +23,7 @@ use syntax::visit::Visitor; // Useful type to use with `Result<>` indicate that an error has already // been reported to the user, so no need to continue checking. -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub struct ErrorReported; pub fn time(do_it: bool, what: &str, u: U, f: F) -> T where diff --git a/src/librustc/util/nodemap.rs b/src/librustc/util/nodemap.rs index 2b05961bb6a05..0da01cd358953 100644 --- a/src/librustc/util/nodemap.rs +++ b/src/librustc/util/nodemap.rs @@ -68,7 +68,7 @@ pub mod DefIdSet { /// /// This uses FNV hashing, as described here: /// http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function -#[deriving(Clone, Copy, Default)] +#[derive(Clone, Copy, Default)] pub struct FnvHasher; #[allow(missing_copy_implementations)] diff --git a/src/librustc/util/snapshot_vec.rs b/src/librustc/util/snapshot_vec.rs index 749c39d7a6b92..11820c908eeba 100644 --- a/src/librustc/util/snapshot_vec.rs +++ b/src/librustc/util/snapshot_vec.rs @@ -22,7 +22,7 @@ use self::UndoLog::*; use std::mem; -#[deriving(PartialEq)] +#[derive(PartialEq)] pub enum UndoLog { /// Indicates where a snapshot started. OpenSnapshot, diff --git a/src/librustc_back/svh.rs b/src/librustc_back/svh.rs index 2374e8b340be7..2ae88aa4476f7 100644 --- a/src/librustc_back/svh.rs +++ b/src/librustc_back/svh.rs @@ -53,7 +53,7 @@ use std::iter::range_step; use syntax::ast; use syntax::visit; -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub struct Svh { hash: String, } @@ -172,7 +172,7 @@ mod svh_visitor { // This enum represents the different potential bits of code the // visitor could encounter that could affect the ABI for the crate, // and assigns each a distinct tag to feed into the hash computation. - #[deriving(Hash)] + #[derive(Hash)] enum SawAbiComponent<'a> { // FIXME (#14132): should we include (some function of) @@ -220,7 +220,7 @@ mod svh_visitor { /// because the SVH is just a developer convenience; there is no /// guarantee of collision-freedom, hash collisions are just /// (hopefully) unlikely.) - #[deriving(Hash)] + #[derive(Hash)] pub enum SawExprComponent<'a> { SawExprLoop(Option), @@ -299,7 +299,7 @@ mod svh_visitor { } /// SawStmtComponent is analogous to SawExprComponent, but for statements. - #[deriving(Hash)] + #[derive(Hash)] pub enum SawStmtComponent { SawStmtDecl, SawStmtExpr, diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index fdc9b72f1e9df..e00433c011474 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -76,7 +76,7 @@ mod x86_64_unknown_linux_gnu; /// Everything `rustc` knows about how to compile for a specific target. /// /// Every field here must be specified, and has no default value. -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct Target { /// [Data layout](http://llvm.org/docs/LangRef.html#data-layout) to pass to LLVM. pub data_layout: String, @@ -99,7 +99,7 @@ pub struct Target { /// /// This has an implementation of `Default`, see each field for what the default is. In general, /// these try to take "minimal defaults" that don't assume anything about the runtime they run in. -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct TargetOptions { /// Linker to invoke. Defaults to "cc". pub linker: String, diff --git a/src/librustc_borrowck/borrowck/check_loans.rs b/src/librustc_borrowck/borrowck/check_loans.rs index 2062685f4c866..26fa0e0d17ce6 100644 --- a/src/librustc_borrowck/borrowck/check_loans.rs +++ b/src/librustc_borrowck/borrowck/check_loans.rs @@ -215,7 +215,7 @@ pub fn check_loans<'a, 'b, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>, } } -#[deriving(PartialEq)] +#[derive(PartialEq)] enum UseError<'tcx> { UseOk, UseWhileBorrowed(/*loan*/Rc>, /*loan*/Span) diff --git a/src/librustc_borrowck/borrowck/fragments.rs b/src/librustc_borrowck/borrowck/fragments.rs index 90da8906a6fa0..0d86811af9f49 100644 --- a/src/librustc_borrowck/borrowck/fragments.rs +++ b/src/librustc_borrowck/borrowck/fragments.rs @@ -30,7 +30,7 @@ use syntax::ast_map; use syntax::attr::AttrMetaMethods; use syntax::codemap::Span; -#[deriving(PartialEq, Eq, PartialOrd, Ord)] +#[derive(PartialEq, Eq, PartialOrd, Ord)] enum Fragment { // This represents the path described by the move path index Just(MovePathIndex), diff --git a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs index 73b345a70af46..a3432d6b6d54d 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs @@ -53,7 +53,7 @@ impl<'tcx> MoveError<'tcx> { } } -#[deriving(Clone)] +#[derive(Clone)] pub struct MoveSpanAndPath { pub span: codemap::Span, pub ident: ast::Ident diff --git a/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs b/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs index ad31c52ca34f0..c55444c84aadd 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/restrictions.rs @@ -21,7 +21,7 @@ use syntax::codemap::Span; use std::rc::Rc; -#[deriving(Show)] +#[derive(Show)] pub enum RestrictionResult<'tcx> { Safe, SafeIf(Rc>, Vec>>) diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index c27b7b30e1345..60a3d5dcef4e5 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -56,7 +56,7 @@ pub mod gather_loans; pub mod move_data; -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct LoanDataFlowOperator; pub type LoanDataFlow<'a, 'tcx> = DataFlowContext<'a, 'tcx, LoanDataFlowOperator>; @@ -287,7 +287,7 @@ impl<'tcx> Loan<'tcx> { } } -#[deriving(Eq, Hash, Show)] +#[derive(Eq, Hash, Show)] pub struct LoanPath<'tcx> { kind: LoanPathKind<'tcx>, ty: ty::Ty<'tcx>, @@ -302,7 +302,7 @@ impl<'tcx> PartialEq for LoanPath<'tcx> { } } -#[deriving(PartialEq, Eq, Hash, Show)] +#[derive(PartialEq, Eq, Hash, Show)] pub enum LoanPathKind<'tcx> { LpVar(ast::NodeId), // `x` in doc.rs LpUpvar(ty::UpvarId), // `x` captured by-value into closure @@ -323,7 +323,7 @@ impl<'tcx> LoanPath<'tcx> { // b2b39e8700e37ad32b486b9a8409b50a8a53aa51#commitcomment-7892003 static DOWNCAST_PRINTED_OPERATOR : &'static str = " as "; -#[deriving(Copy, PartialEq, Eq, Hash, Show)] +#[derive(Copy, PartialEq, Eq, Hash, Show)] pub enum LoanPathElem { LpDeref(mc::PointerKind), // `*LV` in doc.rs LpInterior(mc::InteriorKind) // `LV.f` in doc.rs @@ -472,7 +472,7 @@ pub fn opt_loan_path<'tcx>(cmt: &mc::cmt<'tcx>) -> Option>> { // Errors // Errors that can occur -#[deriving(PartialEq)] +#[derive(PartialEq)] #[allow(missing_copy_implementations)] pub enum bckerr_code { err_mutbl, @@ -482,7 +482,7 @@ pub enum bckerr_code { // Combination of an error code and the categorization of the expression // that caused it -#[deriving(PartialEq)] +#[derive(PartialEq)] pub struct BckError<'tcx> { span: Span, cause: euv::LoanCause, @@ -490,13 +490,13 @@ pub struct BckError<'tcx> { code: bckerr_code } -#[deriving(Copy)] +#[derive(Copy)] pub enum AliasableViolationKind { MutabilityViolation, BorrowViolation(euv::LoanCause) } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum MovedValueUseKind { MovedInUse, MovedInCapture, diff --git a/src/librustc_borrowck/borrowck/move_data.rs b/src/librustc_borrowck/borrowck/move_data.rs index 547e7d272c69d..b49164f0c2547 100644 --- a/src/librustc_borrowck/borrowck/move_data.rs +++ b/src/librustc_borrowck/borrowck/move_data.rs @@ -76,7 +76,7 @@ pub struct FlowedMoveData<'a, 'tcx: 'a> { } /// Index into `MoveData.paths`, used like a pointer -#[deriving(Copy, PartialEq, Eq, PartialOrd, Ord, Show)] +#[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Show)] pub struct MovePathIndex(uint); impl MovePathIndex { @@ -96,7 +96,7 @@ static InvalidMovePathIndex: MovePathIndex = MovePathIndex(uint::MAX); /// Index into `MoveData.moves`, used like a pointer -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub struct MoveIndex(uint); impl MoveIndex { @@ -128,7 +128,7 @@ pub struct MovePath<'tcx> { pub next_sibling: MovePathIndex, } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum MoveKind { Declared, // When declared, variables start out "moved". MoveExpr, // Expression or binding that moves a variable @@ -136,7 +136,7 @@ pub enum MoveKind { Captured // Closure creation that moves a value } -#[deriving(Copy)] +#[derive(Copy)] pub struct Move { /// Path being moved. pub path: MovePathIndex, @@ -151,7 +151,7 @@ pub struct Move { pub next_move: MoveIndex } -#[deriving(Copy)] +#[derive(Copy)] pub struct Assignment { /// Path being assigned. pub path: MovePathIndex, @@ -163,7 +163,7 @@ pub struct Assignment { pub span: Span, } -#[deriving(Copy)] +#[derive(Copy)] pub struct VariantMatch { /// downcast to the variant. pub path: MovePathIndex, @@ -178,12 +178,12 @@ pub struct VariantMatch { pub mode: euv::MatchMode } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct MoveDataFlowOperator; pub type MoveDataFlow<'a, 'tcx> = DataFlowContext<'a, 'tcx, MoveDataFlowOperator>; -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct AssignDataFlowOperator; pub type AssignDataFlow<'a, 'tcx> = DataFlowContext<'a, 'tcx, AssignDataFlowOperator>; diff --git a/src/librustc_borrowck/graphviz.rs b/src/librustc_borrowck/graphviz.rs index e2813c8e9882a..58caeddb019d9 100644 --- a/src/librustc_borrowck/graphviz.rs +++ b/src/librustc_borrowck/graphviz.rs @@ -25,7 +25,7 @@ use rustc::middle::dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit}; use rustc::middle::dataflow; use std::rc::Rc; -#[deriving(Show, Copy)] +#[derive(Show, Copy)] pub enum Variant { Loans, Moves, diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs index 773ea30d401fc..8862845c3855c 100644 --- a/src/librustc_driver/pretty.rs +++ b/src/librustc_driver/pretty.rs @@ -41,7 +41,7 @@ use std::io::{mod, MemReader}; use std::option; use std::str::FromStr; -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum PpSourceMode { PpmNormal, PpmEveryBodyLoops, @@ -52,7 +52,7 @@ pub enum PpSourceMode { PpmExpandedHygiene, } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum PpMode { PpmSource(PpSourceMode), PpmFlowGraph, @@ -315,7 +315,7 @@ fn gather_flowgraph_variants(sess: &Session) -> Vec { variants } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub enum UserIdentifiedItem { ItemViaNode(ast::NodeId), ItemViaPath(Vec), diff --git a/src/librustc_llvm/diagnostic.rs b/src/librustc_llvm/diagnostic.rs index 3bf9c2d44f721..464f9f98e7ffc 100644 --- a/src/librustc_llvm/diagnostic.rs +++ b/src/librustc_llvm/diagnostic.rs @@ -17,7 +17,7 @@ use libc::c_char; use {ValueRef, TwineRef, DebugLocRef, DiagnosticInfoRef}; -#[deriving(Copy)] +#[derive(Copy)] pub enum OptimizationDiagnosticKind { OptimizationRemark, OptimizationMissed, @@ -68,7 +68,7 @@ impl OptimizationDiagnostic { } } -#[deriving(Copy)] +#[derive(Copy)] pub enum Diagnostic { Optimization(OptimizationDiagnostic), diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 296ebcf9cfd8f..192bd94c4b57f 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -68,7 +68,7 @@ pub const False: Bool = 0 as Bool; // Consts for the LLVM CallConv type, pre-cast to uint. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum CallConv { CCallConv = 0, FastCallConv = 8, @@ -78,7 +78,7 @@ pub enum CallConv { X86_64_Win64 = 79, } -#[deriving(Copy)] +#[derive(Copy)] pub enum Visibility { LLVMDefaultVisibility = 0, HiddenVisibility = 1, @@ -89,7 +89,7 @@ pub enum Visibility { // DLLExportLinkage, GhostLinkage and LinkOnceODRAutoHideLinkage. // LinkerPrivateLinkage and LinkerPrivateWeakLinkage are not included either; // they've been removed in upstream LLVM commit r203866. -#[deriving(Copy)] +#[derive(Copy)] pub enum Linkage { ExternalLinkage = 0, AvailableExternallyLinkage = 1, @@ -105,7 +105,7 @@ pub enum Linkage { } #[repr(C)] -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum DiagnosticSeverity { Error, Warning, @@ -146,7 +146,7 @@ bitflags! { #[repr(u64)] -#[deriving(Copy)] +#[derive(Copy)] pub enum OtherAttribute { // The following are not really exposed in // the LLVM c api so instead to add these @@ -167,13 +167,13 @@ pub enum OtherAttribute { NonNullAttribute = 1 << 44, } -#[deriving(Copy)] +#[derive(Copy)] pub enum SpecialAttribute { DereferenceableAttribute(u64) } #[repr(C)] -#[deriving(Copy)] +#[derive(Copy)] pub enum AttributeSet { ReturnIndex = 0, FunctionIndex = !0 @@ -265,7 +265,7 @@ impl AttrBuilder { } // enum for the LLVM IntPredicate type -#[deriving(Copy)] +#[derive(Copy)] pub enum IntPredicate { IntEQ = 32, IntNE = 33, @@ -280,7 +280,7 @@ pub enum IntPredicate { } // enum for the LLVM RealPredicate type -#[deriving(Copy)] +#[derive(Copy)] pub enum RealPredicate { RealPredicateFalse = 0, RealOEQ = 1, @@ -302,7 +302,7 @@ pub enum RealPredicate { // The LLVM TypeKind type - must stay in sync with the def of // LLVMTypeKind in llvm/include/llvm-c/Core.h -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] #[repr(C)] pub enum TypeKind { Void = 0, @@ -324,7 +324,7 @@ pub enum TypeKind { } #[repr(C)] -#[deriving(Copy)] +#[derive(Copy)] pub enum AtomicBinOp { AtomicXchg = 0, AtomicAdd = 1, @@ -340,7 +340,7 @@ pub enum AtomicBinOp { } #[repr(C)] -#[deriving(Copy)] +#[derive(Copy)] pub enum AtomicOrdering { NotAtomic = 0, Unordered = 1, @@ -354,13 +354,13 @@ pub enum AtomicOrdering { // Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h) #[repr(C)] -#[deriving(Copy)] +#[derive(Copy)] pub enum FileType { AssemblyFileType = 0, ObjectFileType = 1 } -#[deriving(Copy)] +#[derive(Copy)] pub enum MetadataType { MD_dbg = 0, MD_tbaa = 1, @@ -371,13 +371,13 @@ pub enum MetadataType { } // Inline Asm Dialect -#[deriving(Copy)] +#[derive(Copy)] pub enum AsmDialect { AD_ATT = 0, AD_Intel = 1 } -#[deriving(Copy, PartialEq, Clone)] +#[derive(Copy, PartialEq, Clone)] #[repr(C)] pub enum CodeGenOptLevel { CodeGenLevelNone = 0, @@ -386,7 +386,7 @@ pub enum CodeGenOptLevel { CodeGenLevelAggressive = 3, } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] #[repr(C)] pub enum RelocMode { RelocDefault = 0, @@ -396,7 +396,7 @@ pub enum RelocMode { } #[repr(C)] -#[deriving(Copy)] +#[derive(Copy)] pub enum CodeGenModel { CodeModelDefault = 0, CodeModelJITDefault = 1, @@ -407,7 +407,7 @@ pub enum CodeGenModel { } #[repr(C)] -#[deriving(Copy)] +#[derive(Copy)] pub enum DiagnosticKind { DK_InlineAsm = 0, DK_StackSize, @@ -513,7 +513,7 @@ pub mod debuginfo { pub type DIArray = DIDescriptor; pub type DISubrange = DIDescriptor; - #[deriving(Copy)] + #[derive(Copy)] pub enum DIDescriptorFlags { FlagPrivate = 1 << 0, FlagProtected = 1 << 1, diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index efb9b636247da..a3fb2286b833e 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -66,7 +66,7 @@ use std::mem::replace; // Specifies how duplicates should be handled when adding a child item if // another item exists with the same name in some namespace. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] enum DuplicateCheckingMode { ForbidDuplicateModules, ForbidDuplicateTypesAndModules, @@ -75,7 +75,7 @@ enum DuplicateCheckingMode { OverwriteDuplicates } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] enum NamespaceError { NoError, ModuleError, diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 11328bedcc493..d1a097e24bce8 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -97,7 +97,7 @@ mod check_unused; mod record_exports; mod build_reduced_graph; -#[deriving(Copy)] +#[derive(Copy)] struct BindingInfo { span: Span, binding_mode: BindingMode, @@ -106,14 +106,14 @@ struct BindingInfo { // Map from the name in a pattern to its binding mode. type BindingMap = HashMap; -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] enum PatternBindingMode { RefutableMode, LocalIrrefutableMode, ArgumentIrrefutableMode, } -#[deriving(Copy, PartialEq, Eq, Hash, Show)] +#[derive(Copy, PartialEq, Eq, Hash, Show)] enum Namespace { TypeNS, ValueNS @@ -122,7 +122,7 @@ enum Namespace { /// A NamespaceResult represents the result of resolving an import in /// a particular namespace. The result is either definitely-resolved, /// definitely- unresolved, or unknown. -#[deriving(Clone)] +#[derive(Clone)] enum NamespaceResult { /// Means that resolve hasn't gathered enough information yet to determine /// whether the name is bound in this namespace. (That is, it hasn't @@ -179,7 +179,7 @@ impl<'a, 'v, 'tcx> Visitor<'v> for Resolver<'a, 'tcx> { } /// Contains data for specific types of import directives. -#[deriving(Copy,Show)] +#[derive(Copy,Show)] enum ImportDirectiveSubclass { SingleImport(Name /* target */, Name /* source */), GlobImport @@ -208,7 +208,7 @@ enum FallbackSuggestion { TraitMethod(String), } -#[deriving(Copy)] +#[derive(Copy)] enum TypeParameters<'a> { NoTypeParameters, HasTypeParameters( @@ -228,7 +228,7 @@ enum TypeParameters<'a> { // The rib kind controls the translation of local // definitions (`DefLocal`) to upvars (`DefUpvar`). -#[deriving(Copy, Show)] +#[derive(Copy, Show)] enum RibKind { // No translation needs to be applied. NormalRibKind, @@ -252,13 +252,13 @@ enum RibKind { } // Methods can be required or provided. RequiredMethod methods only occur in traits. -#[deriving(Copy, Show)] +#[derive(Copy, Show)] enum MethodSort { RequiredMethod, ProvidedMethod(NodeId) } -#[deriving(Copy)] +#[derive(Copy)] enum UseLexicalScopeFlag { DontUseLexicalScope, UseLexicalScope @@ -269,7 +269,7 @@ enum ModulePrefixResult { PrefixFound(Rc, uint) } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] enum NameSearchType { /// We're doing a name search in order to resolve a `use` directive. ImportSearch, @@ -279,7 +279,7 @@ enum NameSearchType { PathSearch, } -#[deriving(Copy)] +#[derive(Copy)] enum BareIdentifierPatternResolution { FoundStructOrEnumVariant(Def, LastPrivate), FoundConst(Def, LastPrivate), @@ -287,7 +287,7 @@ enum BareIdentifierPatternResolution { } /// One local scope. -#[deriving(Show)] +#[derive(Show)] struct Rib { bindings: HashMap, kind: RibKind, @@ -303,14 +303,14 @@ impl Rib { } /// Whether an import can be shadowed by another import. -#[deriving(Show,PartialEq,Clone,Copy)] +#[derive(Show,PartialEq,Clone,Copy)] enum Shadowable { Always, Never } /// One import directive. -#[deriving(Show)] +#[derive(Show)] struct ImportDirective { module_path: Vec, subclass: ImportDirectiveSubclass, @@ -340,7 +340,7 @@ impl ImportDirective { } /// The item that an import resolves to. -#[deriving(Clone,Show)] +#[derive(Clone,Show)] struct Target { target_module: Rc, bindings: Rc, @@ -361,7 +361,7 @@ impl Target { } /// An ImportResolution represents a particular `use` directive. -#[deriving(Show)] +#[derive(Show)] struct ImportResolution { /// Whether this resolution came from a `use` or a `pub use`. Note that this /// should *not* be used whenever resolution is being performed, this is @@ -441,7 +441,7 @@ impl ImportResolution { } /// The link from a module up to its nearest parent node. -#[deriving(Clone,Show)] +#[derive(Clone,Show)] enum ParentLink { NoParentLink, ModuleParentLink(Weak, Name), @@ -449,7 +449,7 @@ enum ParentLink { } /// The type of module this is. -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] enum ModuleKind { NormalModuleKind, TraitModuleKind, @@ -541,7 +541,7 @@ impl fmt::Show for Module { } bitflags! { - #[deriving(Show)] + #[derive(Show)] flags DefModifiers: u8 { const PUBLIC = 0b0000_0001, const IMPORTABLE = 0b0000_0010, @@ -549,7 +549,7 @@ bitflags! { } // Records a possibly-private type definition. -#[deriving(Clone,Show)] +#[derive(Clone,Show)] struct TypeNsDef { modifiers: DefModifiers, // see note in ImportResolution about how to use this module_def: Option>, @@ -558,7 +558,7 @@ struct TypeNsDef { } // Records a possibly-private value definition. -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] struct ValueNsDef { modifiers: DefModifiers, // see note in ImportResolution about how to use this def: Def, @@ -567,14 +567,14 @@ struct ValueNsDef { // Records the definitions (at most one for each namespace) that a name is // bound to. -#[deriving(Show)] +#[derive(Show)] struct NameBindings { type_def: RefCell>, //< Meaning in type namespace. value_def: RefCell>, //< Meaning in value namespace. } /// Ways in which a trait can be referenced -#[deriving(Copy)] +#[derive(Copy)] enum TraitReferenceType { TraitImplementation, // impl SomeTrait for T { ... } TraitDerivation, // trait T : SomeTrait { ... } @@ -903,7 +903,7 @@ struct Resolver<'a, 'tcx:'a> { used_crates: HashSet, } -#[deriving(PartialEq)] +#[derive(PartialEq)] enum FallbackChecks { Everything, OnlyTraitAndStatics @@ -4831,7 +4831,7 @@ pub struct CrateMap { pub glob_map: Option } -#[deriving(PartialEq,Copy)] +#[derive(PartialEq,Copy)] pub enum MakeGlobMap { Yes, No diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index a6f2c7dfed0b1..68d452e0e49bd 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -33,7 +33,7 @@ use std::sync::{Arc, Mutex}; use std::thread; use libc::{c_uint, c_int, c_void}; -#[deriving(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)] +#[derive(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)] pub enum OutputType { OutputTypeBitcode, OutputTypeAssembly, @@ -85,7 +85,7 @@ struct Diagnostic { // We use an Arc instead of just returning a list of diagnostics from the // child task because we need to make sure that the messages are seen even // if the child task panics (for example, when `fatal` is called). -#[deriving(Clone)] +#[derive(Clone)] struct SharedEmitter { buffer: Arc>>, } @@ -255,7 +255,7 @@ fn create_target_machine(sess: &Session) -> TargetMachineRef { /// Module-specific configuration for `optimize_and_codegen`. -#[deriving(Clone)] +#[derive(Clone)] struct ModuleConfig { /// LLVM TargetMachine to use for codegen. tm: TargetMachineRef, diff --git a/src/librustc_trans/save/recorder.rs b/src/librustc_trans/save/recorder.rs index f62073e54e6d9..679a8d2d07bc8 100644 --- a/src/librustc_trans/save/recorder.rs +++ b/src/librustc_trans/save/recorder.rs @@ -61,7 +61,7 @@ macro_rules! svec { }) } -#[deriving(Copy,Show)] +#[derive(Copy,Show)] pub enum Row { Variable, Enum, diff --git a/src/librustc_trans/save/span_utils.rs b/src/librustc_trans/save/span_utils.rs index 244d0476832bd..14c6475c87df9 100644 --- a/src/librustc_trans/save/span_utils.rs +++ b/src/librustc_trans/save/span_utils.rs @@ -21,7 +21,7 @@ use syntax::parse::lexer::{Reader,StringReader}; use syntax::parse::token; use syntax::parse::token::{keywords, Token}; -#[deriving(Clone)] +#[derive(Clone)] pub struct SpanUtils<'a> { pub sess: &'a Session, pub err_count: Cell, diff --git a/src/librustc_trans/trans/_match.rs b/src/librustc_trans/trans/_match.rs index fc68d1d3258e1..a0b3314d3e377 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/trans/_match.rs @@ -227,7 +227,7 @@ use syntax::codemap::Span; use syntax::fold::Folder; use syntax::ptr::P; -#[deriving(Copy, Show)] +#[derive(Copy, Show)] struct ConstantExpr<'a>(&'a ast::Expr); impl<'a> ConstantExpr<'a> { @@ -242,7 +242,7 @@ impl<'a> ConstantExpr<'a> { } // An option identifying a branch (either a literal, an enum variant or a range) -#[deriving(Show)] +#[derive(Show)] enum Opt<'a, 'tcx> { ConstantValue(ConstantExpr<'a>), ConstantRange(ConstantExpr<'a>, ConstantExpr<'a>), @@ -298,7 +298,7 @@ impl<'a, 'tcx> Opt<'a, 'tcx> { } } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum BranchKind { NoBranch, Single, @@ -313,7 +313,7 @@ pub enum OptResult<'blk, 'tcx: 'blk> { LowerBound(Result<'blk, 'tcx>) } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub enum TransBindingMode { TrByCopy(/* llbinding */ ValueRef), TrByMove, @@ -327,7 +327,7 @@ pub enum TransBindingMode { /// - `trmode` is the trans binding mode /// - `id` is the node id of the binding /// - `ty` is the Rust type of the binding -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct BindingInfo<'tcx> { pub llmatch: ValueRef, pub trmode: TransBindingMode, diff --git a/src/librustc_trans/trans/adt.rs b/src/librustc_trans/trans/adt.rs index 24a3bb42c90f7..04dda19559e1e 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -71,7 +71,7 @@ use util::ppaux::ty_to_string; type Hint = attr::ReprAttr; /// Representations. -#[deriving(Eq, PartialEq, Show)] +#[derive(Eq, PartialEq, Show)] pub enum Repr<'tcx> { /// C-like enums; basically an int. CEnum(IntType, Disr, Disr), // discriminant range (signedness based on the IntType) @@ -116,7 +116,7 @@ pub enum Repr<'tcx> { } /// For structs, and struct-like parts of anything fancier. -#[deriving(Eq, PartialEq, Show)] +#[derive(Eq, PartialEq, Show)] pub struct Struct<'tcx> { // If the struct is DST, then the size and alignment do not take into // account the unsized fields of the struct. @@ -468,7 +468,7 @@ fn mk_struct<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, } } -#[deriving(Show)] +#[derive(Show)] struct IntBounds { slo: i64, shi: i64, diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 18155d756807c..a7f641a63ab76 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -547,7 +547,7 @@ pub fn maybe_name_value(cx: &CrateContext, v: ValueRef, s: &str) { // Used only for creating scalar comparison glue. -#[deriving(Copy)] +#[derive(Copy)] pub enum scalar_type { nil_type, signed_int, unsigned_int, floating_point, } pub fn compare_scalar_types<'blk, 'tcx>(cx: Block<'blk, 'tcx>, @@ -1782,7 +1782,7 @@ pub fn build_return_block<'blk, 'tcx>(fcx: &FunctionContext<'blk, 'tcx>, } } -#[deriving(Clone, Copy, Eq, PartialEq)] +#[derive(Clone, Copy, Eq, PartialEq)] pub enum IsUnboxedClosureFlag { NotUnboxedClosure, IsUnboxedClosure, @@ -2204,7 +2204,7 @@ pub fn llvm_linkage_by_name(name: &str) -> Option { /// Enum describing the origin of an LLVM `Value`, for linkage purposes. -#[deriving(Copy)] +#[derive(Copy)] pub enum ValueOrigin { /// The LLVM `Value` is in this context because the corresponding item was /// assigned to the current compilation unit. diff --git a/src/librustc_trans/trans/basic_block.rs b/src/librustc_trans/trans/basic_block.rs index ab25343ff5fe0..d3ff432b5e418 100644 --- a/src/librustc_trans/trans/basic_block.rs +++ b/src/librustc_trans/trans/basic_block.rs @@ -13,7 +13,7 @@ use llvm::{BasicBlockRef}; use trans::value::{Users, Value}; use std::iter::{Filter, Map}; -#[deriving(Copy)] +#[derive(Copy)] pub struct BasicBlock(pub BasicBlockRef); pub type Preds = Map< diff --git a/src/librustc_trans/trans/cabi.rs b/src/librustc_trans/trans/cabi.rs index 9ea158fbe2101..aceaff392895a 100644 --- a/src/librustc_trans/trans/cabi.rs +++ b/src/librustc_trans/trans/cabi.rs @@ -20,7 +20,7 @@ use trans::cabi_arm; use trans::cabi_mips; use trans::type_::Type; -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum ArgKind { /// Pass the argument directly using the normal converted /// LLVM type or by coercing to another specified type @@ -35,7 +35,7 @@ pub enum ArgKind { /// should be passed to or returned from a function /// /// This is borrowed from clang's ABIInfo.h -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct ArgType { pub kind: ArgKind, /// Original LLVM type diff --git a/src/librustc_trans/trans/cabi_x86_64.rs b/src/librustc_trans/trans/cabi_x86_64.rs index fffdc9c97ab97..f59d152fa473c 100644 --- a/src/librustc_trans/trans/cabi_x86_64.rs +++ b/src/librustc_trans/trans/cabi_x86_64.rs @@ -25,7 +25,7 @@ use trans::type_::Type; use std::cmp; use std::iter::repeat; -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] enum RegClass { NoClass, Int, diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs index 169e52bcfe5be..f54cec9f0face 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/trans/callee.rs @@ -58,7 +58,7 @@ use syntax::ast; use syntax::ast_map; use syntax::ptr::P; -#[deriving(Copy)] +#[derive(Copy)] pub struct MethodData { pub llfn: ValueRef, pub llself: ValueRef, @@ -1052,7 +1052,7 @@ pub fn trans_args<'a, 'blk, 'tcx>(cx: Block<'blk, 'tcx>, bcx } -#[deriving(Copy)] +#[derive(Copy)] pub enum AutorefArg { DontAutorefArg, DoAutorefArg(ast::NodeId) diff --git a/src/librustc_trans/trans/cleanup.rs b/src/librustc_trans/trans/cleanup.rs index 8ac427dd06124..c2cfddd8076cc 100644 --- a/src/librustc_trans/trans/cleanup.rs +++ b/src/librustc_trans/trans/cleanup.rs @@ -51,7 +51,7 @@ pub struct CleanupScope<'blk, 'tcx: 'blk> { cached_landing_pad: Option, } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub struct CustomScopeIndex { index: uint } @@ -82,14 +82,14 @@ impl<'blk, 'tcx: 'blk> fmt::Show for CleanupScopeKind<'blk, 'tcx> { } } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum EarlyExitLabel { UnwindExit, ReturnExit, LoopExit(ast::NodeId, uint) } -#[deriving(Copy)] +#[derive(Copy)] pub struct CachedEarlyExit { label: EarlyExitLabel, cleanup_block: BasicBlockRef, @@ -107,7 +107,7 @@ pub trait Cleanup<'tcx> { pub type CleanupObj<'tcx> = Box+'tcx>; -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum ScopeId { AstScope(ast::NodeId), CustomScope(CustomScopeIndex) @@ -871,7 +871,7 @@ impl EarlyExitLabel { /////////////////////////////////////////////////////////////////////////// // Cleanup types -#[deriving(Copy)] +#[derive(Copy)] pub struct DropValue<'tcx> { is_immediate: bool, must_unwind: bool, @@ -909,12 +909,12 @@ impl<'tcx> Cleanup<'tcx> for DropValue<'tcx> { } } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum Heap { HeapExchange } -#[deriving(Copy)] +#[derive(Copy)] pub struct FreeValue<'tcx> { ptr: ValueRef, heap: Heap, @@ -948,7 +948,7 @@ impl<'tcx> Cleanup<'tcx> for FreeValue<'tcx> { } } -#[deriving(Copy)] +#[derive(Copy)] pub struct FreeSlice { ptr: ValueRef, size: ValueRef, @@ -983,7 +983,7 @@ impl<'tcx> Cleanup<'tcx> for FreeSlice { } } -#[deriving(Copy)] +#[derive(Copy)] pub struct LifetimeEnd { ptr: ValueRef, } diff --git a/src/librustc_trans/trans/closure.rs b/src/librustc_trans/trans/closure.rs index 93a5b54fde3e5..6733c76c8e784 100644 --- a/src/librustc_trans/trans/closure.rs +++ b/src/librustc_trans/trans/closure.rs @@ -101,7 +101,7 @@ use syntax::ast_util; // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#[deriving(Copy)] +#[derive(Copy)] pub struct EnvValue<'tcx> { action: ast::CaptureClause, datum: Datum<'tcx, Lvalue> @@ -348,7 +348,7 @@ fn fill_fn_pair(bcx: Block, pair: ValueRef, llfn: ValueRef, llenvptr: ValueRef) Store(bcx, llenvptr, GEPi(bcx, pair, &[0u, abi::FAT_PTR_EXTRA])); } -#[deriving(PartialEq)] +#[derive(PartialEq)] pub enum ClosureKind<'tcx> { NotClosure, // See load_environment. diff --git a/src/librustc_trans/trans/common.rs b/src/librustc_trans/trans/common.rs index aa88224088063..d9fb890b402ef 100644 --- a/src/librustc_trans/trans/common.rs +++ b/src/librustc_trans/trans/common.rs @@ -220,7 +220,7 @@ pub fn gensym_name(name: &str) -> PathElem { PathName(token::gensym(format!("{}:{}", name, num)[])) } -#[deriving(Copy)] +#[derive(Copy)] pub struct tydesc_info<'tcx> { pub ty: Ty<'tcx>, pub tydesc: ValueRef, @@ -255,7 +255,7 @@ pub struct tydesc_info<'tcx> { * */ -#[deriving(Copy)] +#[derive(Copy)] pub struct NodeInfo { pub id: ast::NodeId, pub span: Span, @@ -1074,7 +1074,7 @@ pub fn drain_fulfillment_cx<'a,'tcx,T>(span: Span, } // Key used to lookup values supplied for type parameters in an expr. -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum ExprOrMethodCall { // Type parameters for a path like `None::` ExprId(ast::NodeId), diff --git a/src/librustc_trans/trans/datum.rs b/src/librustc_trans/trans/datum.rs index 83bf06383a89c..e5a7653811fe4 100644 --- a/src/librustc_trans/trans/datum.rs +++ b/src/librustc_trans/trans/datum.rs @@ -33,7 +33,7 @@ use syntax::ast; /// describes where the value is stored, what Rust type the value has, /// whether it is addressed by reference, and so forth. Please refer /// the section on datums in `doc.rs` for more details. -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct Datum<'tcx, K> { /// The llvm value. This is either a pointer to the Rust value or /// the value itself, depending on `kind` below. @@ -51,7 +51,7 @@ pub struct DatumBlock<'blk, 'tcx: 'blk, K> { pub datum: Datum<'tcx, K>, } -#[deriving(Show)] +#[derive(Show)] pub enum Expr { /// a fresh value that was produced and which has no cleanup yet /// because it has not yet "landed" into its permanent home @@ -63,10 +63,10 @@ pub enum Expr { LvalueExpr, } -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub struct Lvalue; -#[deriving(Show)] +#[derive(Show)] pub struct Rvalue { pub mode: RvalueMode } @@ -82,7 +82,7 @@ impl Drop for Rvalue { fn drop(&mut self) { } } -#[deriving(Copy, PartialEq, Eq, Hash, Show)] +#[derive(Copy, PartialEq, Eq, Hash, Show)] pub enum RvalueMode { /// `val` is a pointer to the actual value (and thus has type *T) ByRef, diff --git a/src/librustc_trans/trans/debuginfo.rs b/src/librustc_trans/trans/debuginfo.rs index c651255226b5a..7c08f25f81103 100644 --- a/src/librustc_trans/trans/debuginfo.rs +++ b/src/librustc_trans/trans/debuginfo.rs @@ -248,7 +248,7 @@ const FLAGS_NONE: c_uint = 0; // Public Interface of debuginfo module //=----------------------------------------------------------------------------- -#[deriving(Copy, Show, Hash, Eq, PartialEq, Clone)] +#[derive(Copy, Show, Hash, Eq, PartialEq, Clone)] struct UniqueTypeId(ast::Name); // The TypeMap is where the CrateDebugContext holds the type metadata nodes @@ -2380,7 +2380,7 @@ impl<'tcx> VariantMemberDescriptionFactory<'tcx> { } } -#[deriving(Copy)] +#[derive(Copy)] enum EnumDiscriminantInfo { RegularDiscriminant(DIType), OptimizedDiscriminant, @@ -3107,7 +3107,7 @@ impl MetadataCreationResult { } } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] enum DebugLocation { KnownLocation { scope: DIScope, line: uint, col: uint }, UnknownLocation diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index cf3070919cb38..021a82c4e0472 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -75,7 +75,7 @@ use std::iter::repeat; // These are passed around by the code generating functions to track the // destination of a computation's value. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Dest { SaveIn(ValueRef), Ignore, @@ -1978,7 +1978,7 @@ fn float_cast(bcx: Block, } else { llsrc }; } -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum cast_kind { cast_pointer, cast_integral, diff --git a/src/librustc_trans/trans/mod.rs b/src/librustc_trans/trans/mod.rs index c53e164fb0703..3eba057310113 100644 --- a/src/librustc_trans/trans/mod.rs +++ b/src/librustc_trans/trans/mod.rs @@ -54,7 +54,7 @@ mod basic_block; mod llrepr; mod cleanup; -#[deriving(Copy)] +#[derive(Copy)] pub struct ModuleTranslation { pub llcx: ContextRef, pub llmod: ModuleRef, diff --git a/src/librustc_trans/trans/monomorphize.rs b/src/librustc_trans/trans/monomorphize.rs index 7c8ba08d98750..9a04b6ae0e28f 100644 --- a/src/librustc_trans/trans/monomorphize.rs +++ b/src/librustc_trans/trans/monomorphize.rs @@ -286,7 +286,7 @@ pub fn monomorphic_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, (lldecl, true) } -#[deriving(PartialEq, Eq, Hash, Show)] +#[derive(PartialEq, Eq, Hash, Show)] pub struct MonoId<'tcx> { pub def: ast::DefId, pub params: subst::VecPerParamSpace> diff --git a/src/librustc_trans/trans/tvec.rs b/src/librustc_trans/trans/tvec.rs index 688a0d0725058..253df32567a2a 100644 --- a/src/librustc_trans/trans/tvec.rs +++ b/src/librustc_trans/trans/tvec.rs @@ -89,7 +89,7 @@ pub fn make_drop_glue_unboxed<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, }) } -#[deriving(Copy)] +#[derive(Copy)] pub struct VecTypes<'tcx> { pub unit_ty: Ty<'tcx>, pub llunit_ty: Type, diff --git a/src/librustc_trans/trans/type_.rs b/src/librustc_trans/trans/type_.rs index 2cc40a6179508..5b76f5bb8270e 100644 --- a/src/librustc_trans/trans/type_.rs +++ b/src/librustc_trans/trans/type_.rs @@ -26,7 +26,7 @@ use std::iter::repeat; use libc::c_uint; -#[deriving(Clone, Copy, PartialEq, Show)] +#[derive(Clone, Copy, PartialEq, Show)] #[repr(C)] pub struct Type { rf: TypeRef diff --git a/src/librustc_trans/trans/type_of.rs b/src/librustc_trans/trans/type_of.rs index 0bc35390cd7c0..26116d196565c 100644 --- a/src/librustc_trans/trans/type_of.rs +++ b/src/librustc_trans/trans/type_of.rs @@ -446,7 +446,7 @@ pub fn align_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) } // Want refinements! (Or case classes, I guess -#[deriving(Copy)] +#[derive(Copy)] pub enum named_ty { a_struct, an_enum, diff --git a/src/librustc_trans/trans/value.rs b/src/librustc_trans/trans/value.rs index 9e959ce4221e7..e6b13408d2a7b 100644 --- a/src/librustc_trans/trans/value.rs +++ b/src/librustc_trans/trans/value.rs @@ -14,7 +14,7 @@ use trans::basic_block::BasicBlock; use trans::common::Block; use libc::c_uint; -#[deriving(Copy)] +#[derive(Copy)] pub struct Value(pub ValueRef); macro_rules! opt_val { ($e:expr) => ( @@ -125,7 +125,7 @@ impl Value { } /// Wrapper for LLVM UseRef -#[deriving(Copy)] +#[derive(Copy)] pub struct Use(UseRef); impl Use { diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 4e6593dedddf7..5ded53f888ab1 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -45,7 +45,7 @@ pub enum MethodError { // A pared down enum describing just the places from which a method // candidate can arise. Used for error reporting only. -#[deriving(Copy, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Copy, PartialOrd, Ord, PartialEq, Eq)] pub enum CandidateSource { ImplSource(ast::DefId), TraitSource(/* trait id */ ast::DefId), diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index f00e3e2d4527a..1f20916a04137 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -70,7 +70,7 @@ pub struct Pick<'tcx> { pub kind: PickKind<'tcx>, } -#[deriving(Clone,Show)] +#[derive(Clone,Show)] pub enum PickKind<'tcx> { InherentImplPick(/* Impl */ ast::DefId), ObjectPick(/* Trait */ ast::DefId, /* method_num */ uint, /* real_index */ uint), @@ -85,7 +85,7 @@ pub type PickResult<'tcx> = Result, MethodError>; // difference is that it doesn't embed any regions or other // specifics. The "confirmation" step recreates those details as // needed. -#[deriving(Clone,Show)] +#[derive(Clone,Show)] pub enum PickAdjustment { // Indicates that the source expression should be autoderef'd N times // diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index d4e025a38131e..3de61df2827d1 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -168,7 +168,7 @@ pub struct Inherited<'a, 'tcx: 'a> { /// When type-checking an expression, we propagate downward /// whatever type hint we are able in the form of an `Expectation`. -#[deriving(Copy)] +#[derive(Copy)] enum Expectation<'tcx> { /// We know nothing about what type this expression should have. NoExpectation, @@ -219,7 +219,7 @@ impl<'tcx> Expectation<'tcx> { } } -#[deriving(Copy, Clone)] +#[derive(Copy, Clone)] pub struct UnsafetyState { pub def: ast::NodeId, pub unsafety: ast::Unsafety, @@ -255,13 +255,13 @@ impl UnsafetyState { /// Whether `check_binop` is part of an assignment or not. /// Used to know whether we allow user overloads and to print /// better messages on error. -#[deriving(PartialEq)] +#[derive(PartialEq)] enum IsBinopAssignment{ SimpleBinop, BinopAssignment, } -#[deriving(Clone)] +#[derive(Clone)] pub struct FnCtxt<'a, 'tcx: 'a> { body_id: ast::NodeId, @@ -2199,7 +2199,7 @@ impl<'a, 'tcx> RegionScope for FnCtxt<'a, 'tcx> { } } -#[deriving(Copy, Show, PartialEq, Eq)] +#[derive(Copy, Show, PartialEq, Eq)] pub enum LvaluePreference { PreferMutLvalue, NoPreference @@ -3040,7 +3040,7 @@ pub fn lookup_tup_field_ty<'tcx>(tcx: &ty::ctxt<'tcx>, // Controls whether the arguments are automatically referenced. This is useful // for overloaded binary and unary operators. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum AutorefArgs { Yes, No, @@ -3062,7 +3062,7 @@ pub enum AutorefArgs { /// Instead of: /// /// f((1, 2)); -#[deriving(Clone, Eq, PartialEq)] +#[derive(Clone, Eq, PartialEq)] enum TupleArgumentsFlag { DontTupleArguments, TupleArguments, diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs index 5ef9757b91ac2..d50e99360f217 100644 --- a/src/librustc_typeck/check/writeback.rs +++ b/src/librustc_typeck/check/writeback.rs @@ -329,7 +329,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> { /////////////////////////////////////////////////////////////////////////// // Resolution reason. -#[deriving(Copy)] +#[derive(Copy)] enum ResolveReason { ResolvingExpr(Span), ResolvingLocal(Span), diff --git a/src/librustc_typeck/rscope.rs b/src/librustc_typeck/rscope.rs index c62218313f4e8..b2d7d88cb11bf 100644 --- a/src/librustc_typeck/rscope.rs +++ b/src/librustc_typeck/rscope.rs @@ -37,7 +37,7 @@ pub trait RegionScope { // A scope in which all regions must be explicitly named. This is used // for types that appear in structs and so on. -#[deriving(Copy)] +#[derive(Copy)] pub struct ExplicitRscope; impl RegionScope for ExplicitRscope { diff --git a/src/librustc_typeck/variance.rs b/src/librustc_typeck/variance.rs index a17f3b31be321..1163513021f06 100644 --- a/src/librustc_typeck/variance.rs +++ b/src/librustc_typeck/variance.rs @@ -230,10 +230,10 @@ pub fn infer_variance(tcx: &ty::ctxt) { type VarianceTermPtr<'a> = &'a VarianceTerm<'a>; -#[deriving(Copy, Show)] +#[derive(Copy, Show)] struct InferredIndex(uint); -#[deriving(Copy)] +#[derive(Copy)] enum VarianceTerm<'a> { ConstantTerm(ty::Variance), TransformTerm(VarianceTermPtr<'a>, VarianceTermPtr<'a>), @@ -266,7 +266,7 @@ struct TermsContext<'a, 'tcx: 'a> { inferred_infos: Vec> , } -#[deriving(Copy, Show, PartialEq)] +#[derive(Copy, Show, PartialEq)] enum ParamKind { TypeParam, RegionParam @@ -423,7 +423,7 @@ struct ConstraintContext<'a, 'tcx: 'a> { /// Declares that the variable `decl_id` appears in a location with /// variance `variance`. -#[deriving(Copy)] +#[derive(Copy)] struct Constraint<'a> { inferred: InferredIndex, variance: &'a VarianceTerm<'a>, diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 459d6409f676a..66966e93b6791 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -111,7 +111,7 @@ impl, U> Clean> for syntax::owned_slice::OwnedSlice { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Crate { pub name: String, pub src: FsPath, @@ -193,7 +193,7 @@ impl<'a, 'tcx> Clean for visit_ast::RustdocVisitor<'a, 'tcx> { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct ExternalCrate { pub name: String, pub attrs: Vec, @@ -226,7 +226,7 @@ impl Clean for cstore::crate_metadata { /// Anything with a source location and set of attributes and, optionally, a /// name. That is, anything that can be documented. This doesn't correspond /// directly to the AST's concept of an item; it's a strict superset. -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Item { /// Stringified span pub source: Span, @@ -302,7 +302,7 @@ impl Item { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub enum ItemEnum { StructItem(Struct), EnumItem(Enum), @@ -331,7 +331,7 @@ pub enum ItemEnum { AssociatedTypeItem(TyParam), } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Module { pub items: Vec, pub is_crate: bool, @@ -398,7 +398,7 @@ impl Clean for doctree::Module { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub enum Attribute { Word(String), List(String, Vec ), @@ -451,7 +451,7 @@ impl<'a> attr::AttrMetaMethods for &'a Attribute { fn meta_item_list(&self) -> Option<&[P]> { None } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct TyParam { pub name: String, pub did: ast::DefId, @@ -484,7 +484,7 @@ impl<'tcx> Clean for ty::TypeParameterDef<'tcx> { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub enum TyParamBound { RegionBound(Lifetime), TraitBound(PolyTrait, ast::TraitBoundModifier) @@ -675,7 +675,7 @@ impl<'tcx> Clean>> for subst::Substs<'tcx> { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct Lifetime(String); impl Lifetime { @@ -725,7 +725,7 @@ impl Clean> for ty::Region { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub enum WherePredicate { BoundPredicate { ty: Type, bounds: Vec }, RegionPredicate { lifetime: Lifetime, bounds: Vec}, @@ -758,7 +758,7 @@ impl Clean for ast::WherePredicate { } // maybe use a Generic enum and use ~[Generic]? -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct Generics { pub lifetimes: Vec, pub type_params: Vec, @@ -786,7 +786,7 @@ impl<'a, 'tcx> Clean for (&'a ty::Generics<'tcx>, subst::ParamSpace) { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Method { pub generics: Generics, pub self_: SelfTy, @@ -825,7 +825,7 @@ impl Clean for ast::Method { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct TyMethod { pub unsafety: ast::Unsafety, pub decl: FnDecl, @@ -863,7 +863,7 @@ impl Clean for ast::TypeMethod { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub enum SelfTy { SelfStatic, SelfValue, @@ -884,7 +884,7 @@ impl Clean for ast::ExplicitSelf_ { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Function { pub decl: FnDecl, pub generics: Generics, @@ -909,7 +909,7 @@ impl Clean for doctree::Function { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct ClosureDecl { pub lifetimes: Vec, pub decl: FnDecl, @@ -930,14 +930,14 @@ impl Clean for ast::ClosureTy { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct FnDecl { pub inputs: Arguments, pub output: FunctionRetTy, pub attrs: Vec, } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct Arguments { pub values: Vec, } @@ -990,7 +990,7 @@ impl<'a, 'tcx> Clean for (ast::DefId, &'a ty::PolyFnSig<'tcx>) { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct Argument { pub type_: Type, pub name: String, @@ -1007,7 +1007,7 @@ impl Clean for ast::Arg { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub enum FunctionRetTy { Return(Type), NoReturn @@ -1022,7 +1022,7 @@ impl Clean for ast::FunctionRetTy { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Trait { pub unsafety: ast::Unsafety, pub items: Vec, @@ -1066,7 +1066,7 @@ impl Clean for ast::PolyTraitRef { /// An item belonging to a trait, whether a method or associated. Could be named /// TraitItem except that's already taken by an exported enum variant. -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub enum TraitMethod { RequiredMethod(Item), ProvidedMethod(Item), @@ -1111,7 +1111,7 @@ impl Clean for ast::TraitItem { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub enum ImplMethod { MethodImplItem(Item), TypeImplItem(Item), @@ -1182,7 +1182,7 @@ impl<'tcx> Clean for ty::ImplOrTraitItem<'tcx> { } /// A trait reference, which may have higher ranked lifetimes. -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct PolyTrait { pub trait_: Type, pub lifetimes: Vec @@ -1191,7 +1191,7 @@ pub struct PolyTrait { /// A representation of a Type suitable for hyperlinking purposes. Ideally one can get the original /// type out of the AST/ty::ctxt given one of these, if more information is needed. Most importantly /// it does not preserve mutability or boxes. -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub enum Type { /// structs/enums/traits (anything that'd be an ast::TyPath) ResolvedPath { @@ -1237,7 +1237,7 @@ pub enum Type { PolyTraitRef(Vec), } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Copy)] pub enum PrimitiveType { Int, I8, I16, I32, I64, Uint, U8, U16, U32, U64, @@ -1249,7 +1249,7 @@ pub enum PrimitiveType { PrimitiveTuple, } -#[deriving(Clone, RustcEncodable, RustcDecodable, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, Copy)] pub enum TypeKind { TypeEnum, TypeFunction, @@ -1505,7 +1505,7 @@ impl Clean for ast::QPath { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub enum StructField { HiddenStructField, // inserted later by strip passes TypedStructField(Type), @@ -1564,7 +1564,7 @@ impl Clean> for ast::Visibility { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Struct { pub struct_type: doctree::StructType, pub generics: Generics, @@ -1594,7 +1594,7 @@ impl Clean for doctree::Struct { /// This is a more limited form of the standard Struct, different in that /// it lacks the things most items have (name, id, parameterization). Found /// only as a variant in an enum. -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct VariantStruct { pub struct_type: doctree::StructType, pub fields: Vec, @@ -1611,7 +1611,7 @@ impl Clean for syntax::ast::StructDef { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Enum { pub variants: Vec, pub generics: Generics, @@ -1636,7 +1636,7 @@ impl Clean for doctree::Enum { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Variant { pub kind: VariantKind, } @@ -1704,7 +1704,7 @@ impl<'tcx> Clean for ty::VariantInfo<'tcx> { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub enum VariantKind { CLikeVariant, TupleVariant(Vec), @@ -1726,7 +1726,7 @@ impl Clean for ast::VariantKind { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, Show)] +#[derive(Clone, RustcEncodable, RustcDecodable, Show)] pub struct Span { pub filename: String, pub loline: uint, @@ -1761,7 +1761,7 @@ impl Clean for syntax::codemap::Span { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct Path { pub global: bool, pub segments: Vec, @@ -1776,7 +1776,7 @@ impl Clean for ast::Path { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub enum PathParameters { AngleBracketed { lifetimes: Vec, @@ -1808,7 +1808,7 @@ impl Clean for ast::PathParameters { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct PathSegment { pub name: String, pub params: PathParameters @@ -1849,7 +1849,7 @@ impl Clean for ast::Name { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Typedef { pub type_: Type, pub generics: Generics, @@ -1872,7 +1872,7 @@ impl Clean for doctree::Typedef { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq)] pub struct BareFunctionDecl { pub unsafety: ast::Unsafety, pub generics: Generics, @@ -1895,7 +1895,7 @@ impl Clean for ast::BareFnTy { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, Show)] +#[derive(Clone, RustcEncodable, RustcDecodable, Show)] pub struct Static { pub type_: Type, pub mutability: Mutability, @@ -1924,7 +1924,7 @@ impl Clean for doctree::Static { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, Show)] +#[derive(Clone, RustcEncodable, RustcDecodable, Show)] pub struct Constant { pub type_: Type, pub expr: String, @@ -1947,7 +1947,7 @@ impl Clean for doctree::Constant { } } -#[deriving(Show, Clone, RustcEncodable, RustcDecodable, PartialEq, Copy)] +#[derive(Show, Clone, RustcEncodable, RustcDecodable, PartialEq, Copy)] pub enum Mutability { Mutable, Immutable, @@ -1962,7 +1962,7 @@ impl Clean for ast::Mutability { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Impl { pub generics: Generics, pub trait_: Option, @@ -2000,7 +2000,7 @@ impl Clean for doctree::Impl { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct ViewItem { pub inner: ViewItemInner, } @@ -2066,7 +2066,7 @@ impl Clean> for ast::ViewItem { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub enum ViewItemInner { ExternCrate(String, Option, ast::NodeId), Import(ViewPath) @@ -2089,7 +2089,7 @@ impl Clean for ast::ViewItem_ { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub enum ViewPath { // use source as str; SimpleImport(String, ImportSource), @@ -2099,7 +2099,7 @@ pub enum ViewPath { ImportList(ImportSource, Vec), } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct ImportSource { pub path: Path, pub did: Option, @@ -2120,7 +2120,7 @@ impl Clean for ast::ViewPath { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct ViewListIdent { pub name: String, pub source: Option, @@ -2335,7 +2335,7 @@ fn resolve_def(cx: &DocContext, id: ast::NodeId) -> Option { }) } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Macro { pub source: String, } @@ -2356,7 +2356,7 @@ impl Clean for doctree::Macro { } } -#[deriving(Clone, RustcEncodable, RustcDecodable)] +#[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Stability { pub level: attr::StabilityLevel, pub text: String diff --git a/src/librustdoc/doctree.rs b/src/librustdoc/doctree.rs index 251ce5aefeb71..d05e15ff25132 100644 --- a/src/librustdoc/doctree.rs +++ b/src/librustdoc/doctree.rs @@ -70,7 +70,7 @@ impl Module { } } -#[deriving(Show, Clone, RustcEncodable, RustcDecodable, Copy)] +#[derive(Show, Clone, RustcEncodable, RustcDecodable, Copy)] pub enum StructType { /// A normal struct Plain, @@ -143,7 +143,7 @@ pub struct Typedef { pub stab: Option, } -#[deriving(Show)] +#[derive(Show)] pub struct Static { pub type_: P, pub mutability: ast::Mutability, diff --git a/src/librustdoc/externalfiles.rs b/src/librustdoc/externalfiles.rs index 25a20e5998bd8..157d2580ad971 100644 --- a/src/librustdoc/externalfiles.rs +++ b/src/librustdoc/externalfiles.rs @@ -10,7 +10,7 @@ use std::{io, str}; -#[deriving(Clone)] +#[derive(Clone)] pub struct ExternalHtml{ pub in_header: String, pub before_content: String, diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 3c09a10f3d98e..fddd9887ddf0c 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -29,19 +29,19 @@ use html::render::{cache, CURRENT_LOCATION_KEY}; /// Helper to render an optional visibility with a space after it (if the /// visibility is preset) -#[deriving(Copy)] +#[derive(Copy)] pub struct VisSpace(pub Option); /// Similarly to VisSpace, this structure is used to render a function style with a /// space after it. -#[deriving(Copy)] +#[derive(Copy)] pub struct UnsafetySpace(pub ast::Unsafety); /// Wrapper struct for properly emitting a method declaration. pub struct Method<'a>(pub &'a clean::SelfTy, pub &'a clean::FnDecl); /// Similar to VisSpace, but used for mutability -#[deriving(Copy)] +#[derive(Copy)] pub struct MutableSpace(pub clean::Mutability); /// Similar to VisSpace, but used for mutability -#[deriving(Copy)] +#[derive(Copy)] pub struct RawMutableSpace(pub clean::Mutability); /// Wrapper struct for properly emitting the stability level. pub struct Stability<'a>(pub &'a Option); diff --git a/src/librustdoc/html/item_type.rs b/src/librustdoc/html/item_type.rs index 7c346539f6a79..3efaf5d491442 100644 --- a/src/librustdoc/html/item_type.rs +++ b/src/librustdoc/html/item_type.rs @@ -19,7 +19,7 @@ use clean; /// discriminants. JavaScript then is used to decode them into the original value. /// Consequently, every change to this type should be synchronized to /// the `itemTypes` mapping table in `static/main.js`. -#[deriving(Copy, PartialEq, Clone)] +#[derive(Copy, PartialEq, Clone)] pub enum ItemType { Module = 0, Struct = 1, diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 23f31580619ee..d47c6010be0ba 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -13,7 +13,7 @@ use std::io; use externalfiles::ExternalHtml; -#[deriving(Clone)] +#[derive(Clone)] pub struct Layout { pub logo: String, pub favicon: String, diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 2c05524ea7f7b..6268b4cc45543 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -372,7 +372,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) { } } -#[deriving(Eq, PartialEq, Clone, Show)] +#[derive(Eq, PartialEq, Clone, Show)] struct LangString { should_fail: bool, no_run: bool, diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index f8a0b88b4088d..3f74e51f0c246 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -74,7 +74,7 @@ use stability_summary; /// It is intended that this context is a lightweight object which can be fairly /// easily cloned because it is cloned per work-job (about once per item in the /// rustdoc tree). -#[deriving(Clone)] +#[derive(Clone)] pub struct Context { /// Current hierarchy of components leading down to what's currently being /// rendered @@ -129,7 +129,7 @@ pub struct Implementor { } /// Metadata about implementations for a type. -#[deriving(Clone)] +#[derive(Clone)] pub struct Impl { pub impl_: clean::Impl, pub dox: Option, @@ -145,7 +145,7 @@ pub struct Impl { /// to be a fairly large and expensive structure to clone. Instead this adheres /// to `Send` so it may be stored in a `Arc` instance and shared among the various /// rendering tasks. -#[deriving(Default)] +#[derive(Default)] pub struct Cache { /// Mapping of typaram ids to the name of the type parameter. This is used /// when pretty-printing a type (so pretty printing doesn't have to @@ -225,7 +225,7 @@ struct Source<'a>(&'a str); // Helper structs for rendering items/sidebars and carrying along contextual // information -#[deriving(Copy)] +#[derive(Copy)] struct Item<'a> { cx: &'a Context, item: &'a clean::Item, diff --git a/src/librustdoc/html/toc.rs b/src/librustdoc/html/toc.rs index 82081a01956bb..71313ea90b8ae 100644 --- a/src/librustdoc/html/toc.rs +++ b/src/librustdoc/html/toc.rs @@ -14,7 +14,7 @@ use std::fmt; use std::string::String; /// A (recursive) table of contents -#[deriving(PartialEq)] +#[derive(PartialEq)] pub struct Toc { /// The levels are strictly decreasing, i.e. /// @@ -38,7 +38,7 @@ impl Toc { } } -#[deriving(PartialEq)] +#[derive(PartialEq)] pub struct TocEntry { level: u32, sec_number: String, @@ -48,7 +48,7 @@ pub struct TocEntry { } /// Progressive construction of a table of contents. -#[deriving(PartialEq)] +#[derive(PartialEq)] pub struct TocBuilder { top_level: Toc, /// The current hierarchy of parent headings, the levels are diff --git a/src/librustdoc/stability_summary.rs b/src/librustdoc/stability_summary.rs index 2e3adf8e76787..1509d16d6c467 100644 --- a/src/librustdoc/stability_summary.rs +++ b/src/librustdoc/stability_summary.rs @@ -25,9 +25,9 @@ use clean::{TypeTraitItem, ViewItemItem, PrimitiveItem, Stability}; use html::render::cache; -#[deriving(Zero, RustcEncodable, RustcDecodable, PartialEq, Eq)] +#[derive(Zero, RustcEncodable, RustcDecodable, PartialEq, Eq)] /// The counts for each stability level. -#[deriving(Copy)] +#[derive(Copy)] pub struct Counts { pub deprecated: uint, pub experimental: uint, @@ -73,7 +73,7 @@ impl Counts { } } -#[deriving(RustcEncodable, RustcDecodable, PartialEq, Eq)] +#[derive(RustcEncodable, RustcDecodable, PartialEq, Eq)] /// A summarized module, which includes total counts and summarized children /// modules. pub struct ModuleSummary { diff --git a/src/libserialize/base64.rs b/src/libserialize/base64.rs index 54b390e0c3f0a..52d5a1a3af52f 100644 --- a/src/libserialize/base64.rs +++ b/src/libserialize/base64.rs @@ -19,7 +19,7 @@ use std::fmt; use std::error; /// Available encoding character sets -#[deriving(Copy)] +#[derive(Copy)] pub enum CharacterSet { /// The standard character set (uses `+` and `/`) Standard, @@ -28,7 +28,7 @@ pub enum CharacterSet { } /// Available newline types -#[deriving(Copy)] +#[derive(Copy)] pub enum Newline { /// A linefeed (i.e. Unix-style newline) LF, @@ -37,7 +37,7 @@ pub enum Newline { } /// Contains configuration parameters for `to_base64`. -#[deriving(Copy)] +#[derive(Copy)] pub struct Config { /// Character set to use pub char_set: CharacterSet, @@ -177,7 +177,7 @@ pub trait FromBase64 for Sized? { } /// Errors that can occur when decoding a base64 encoded string -#[deriving(Copy)] +#[derive(Copy)] pub enum FromBase64Error { /// The input contained a character not part of the base64 format InvalidBase64Byte(u8, uint), diff --git a/src/libserialize/hex.rs b/src/libserialize/hex.rs index 977a31c240bd3..c915ddaaa9c04 100644 --- a/src/libserialize/hex.rs +++ b/src/libserialize/hex.rs @@ -61,7 +61,7 @@ pub trait FromHex for Sized? { } /// Errors that can occur when decoding a hex encoded string -#[deriving(Copy)] +#[derive(Copy)] pub enum FromHexError { /// The input contained a character not part of the hex format InvalidHexCharacter(char, uint), diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 8a9c2eebf3a53..27bab8176525d 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -60,7 +60,7 @@ //! To be able to encode a piece of data, it must implement the `serialize::RustcEncodable` trait. //! To be able to decode a piece of data, it must implement the `serialize::RustcDecodable` trait. //! The Rust compiler provides an annotation to automatically generate the code for these traits: -//! `#[deriving(RustcDecodable, RustcEncodable)]` +//! `#[derive(RustcDecodable, RustcEncodable)]` //! //! The JSON API provides an enum `json::Json` and a trait `ToJson` to encode objects. //! The `ToJson` trait provides a `to_json` method to convert an object into a `json::Json` value. @@ -81,7 +81,7 @@ //! use serialize::json; //! //! // Automatically generate `Decodable` and `Encodable` trait implementations -//! #[deriving(Decodable, Encodable)] +//! #[derive(Decodable, Encodable)] //! pub struct TestStruct { //! data_int: u8, //! data_str: String, @@ -128,7 +128,7 @@ //! } //! //! // Only generate `RustcEncodable` trait implementation -//! #[deriving(Encodable)] +//! #[derive(Encodable)] //! pub struct ComplexNumRecord { //! uid: u8, //! dsc: String, @@ -155,7 +155,7 @@ //! use serialize::json::{mod, Json, ToJson}; //! //! // Only generate `Decodable` trait implementation -//! #[deriving(Decodable)] +//! #[derive(Decodable)] //! pub struct TestStruct { //! data_int: u8, //! data_str: String, @@ -212,7 +212,7 @@ use unicode::str::Utf16Item; use Encodable; /// Represents a json value -#[deriving(Clone, PartialEq, PartialOrd)] +#[derive(Clone, PartialEq, PartialOrd)] pub enum Json { I64(i64), U64(u64), @@ -228,7 +228,7 @@ pub type Array = Vec; pub type Object = BTreeMap; /// The errors that can arise while parsing a JSON stream. -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum ErrorCode { InvalidSyntax, InvalidNumber, @@ -249,7 +249,7 @@ pub enum ErrorCode { NotUtf8, } -#[deriving(Clone, Copy, PartialEq, Show)] +#[derive(Clone, Copy, PartialEq, Show)] pub enum ParserError { /// msg, line, col SyntaxError(ErrorCode, uint, uint), @@ -259,7 +259,7 @@ pub enum ParserError { // Builder and Parser have the same errors. pub type BuilderError = ParserError; -#[deriving(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Show)] pub enum DecoderError { ParseError(ParserError), ExpectedError(string::String, string::String), @@ -1144,7 +1144,7 @@ impl ops::Index for Json { } /// The output of the streaming parser. -#[deriving(PartialEq, Clone, Show)] +#[derive(PartialEq, Clone, Show)] pub enum JsonEvent { ObjectStart, ObjectEnd, @@ -1159,7 +1159,7 @@ pub enum JsonEvent { Error(ParserError), } -#[deriving(PartialEq, Show)] +#[derive(PartialEq, Show)] enum ParserState { // Parse a value in an array, true means first element. ParseArray(bool), @@ -1188,7 +1188,7 @@ pub struct Stack { /// StackElements compose a Stack. /// For example, Key("foo"), Key("bar"), Index(3) and Key("x") are the /// StackElements compositing the stack that represents foo.bar[3].x -#[deriving(PartialEq, Clone, Show)] +#[derive(PartialEq, Clone, Show)] pub enum StackElement<'l> { Index(u32), Key(&'l str), @@ -1196,7 +1196,7 @@ pub enum StackElement<'l> { // Internally, Key elements are stored as indices in a buffer to avoid // allocating a string for every member of an object. -#[deriving(PartialEq, Clone, Show)] +#[derive(PartialEq, Clone, Show)] enum InternalStackElement { InternalIndex(u32), InternalKey(u16, u16), // start, size @@ -2457,7 +2457,7 @@ mod tests { use std::num::Float; use std::string; - #[deriving(RustcDecodable, Eq, PartialEq, Show)] + #[derive(RustcDecodable, Eq, PartialEq, Show)] struct OptionData { opt: Option, } @@ -2484,20 +2484,20 @@ mod tests { ExpectedError("Number".to_string(), "false".to_string())); } - #[deriving(PartialEq, RustcEncodable, RustcDecodable, Show)] + #[derive(PartialEq, RustcEncodable, RustcDecodable, Show)] enum Animal { Dog, Frog(string::String, int) } - #[deriving(PartialEq, RustcEncodable, RustcDecodable, Show)] + #[derive(PartialEq, RustcEncodable, RustcDecodable, Show)] struct Inner { a: (), b: uint, c: Vec, } - #[deriving(PartialEq, RustcEncodable, RustcDecodable, Show)] + #[derive(PartialEq, RustcEncodable, RustcDecodable, Show)] struct Outer { inner: Vec, } @@ -3041,7 +3041,7 @@ mod tests { ); } - #[deriving(RustcDecodable)] + #[derive(RustcDecodable)] struct FloatStruct { f: f64, a: Vec @@ -3090,7 +3090,7 @@ mod tests { Err(SyntaxError(EOFWhileParsingObject, 3u, 8u))); } - #[deriving(RustcDecodable)] + #[derive(RustcDecodable)] #[allow(dead_code)] struct DecodeStruct { x: f64, @@ -3098,7 +3098,7 @@ mod tests { z: string::String, w: Vec } - #[deriving(RustcDecodable)] + #[derive(RustcDecodable)] enum DecodeEnum { A(f64), B(string::String) diff --git a/src/libstd/bitflags.rs b/src/libstd/bitflags.rs index aeb4df402a2cf..ce4e64f7c15d5 100644 --- a/src/libstd/bitflags.rs +++ b/src/libstd/bitflags.rs @@ -121,7 +121,7 @@ macro_rules! bitflags { ($(#[$attr:meta])* flags $BitFlags:ident: $T:ty { $($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+ }) => { - #[deriving(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)] + #[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)] $(#[$attr])* pub struct $BitFlags { bits: $T, diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs index 46498610e5604..0889f76491238 100644 --- a/src/libstd/c_str.rs +++ b/src/libstd/c_str.rs @@ -487,7 +487,7 @@ fn check_for_null(v: &[u8], buf: *mut libc::c_char) { /// /// Use with the `std::iter` module. #[allow(raw_pointer_deriving)] -#[deriving(Clone)] +#[derive(Clone)] pub struct CChars<'a> { ptr: *const libc::c_char, marker: marker::ContravariantLifetime<'a>, diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index f6063df543489..143d230635c8e 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -52,7 +52,7 @@ pub const INITIAL_CAPACITY: uint = 1 << INITIAL_LOG2_CAP; // 2^5 /// This behavior is characterized by the following condition: /// /// - if size > 0.909 * capacity: grow the map -#[deriving(Clone)] +#[derive(Clone)] struct DefaultResizePolicy; impl DefaultResizePolicy { @@ -215,7 +215,7 @@ fn test_resize_policy() { /// overridden with one of the constructors. /// /// It is required that the keys implement the `Eq` and `Hash` traits, although -/// this can frequently be achieved by using `#[deriving(Eq, Hash)]`. +/// this can frequently be achieved by using `#[derive(Eq, Hash)]`. /// /// Relevant papers/articles: /// @@ -270,7 +270,7 @@ fn test_resize_policy() { /// ``` /// use std::collections::HashMap; /// -/// #[deriving(Hash, Eq, PartialEq, Show)] +/// #[derive(Hash, Eq, PartialEq, Show)] /// struct Viking { /// name: String, /// country: String, @@ -295,7 +295,7 @@ fn test_resize_policy() { /// println!("{} has {} hp", viking, health); /// } /// ``` -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct HashMap { // All hashes are keyed on these values, to prevent hash collision attacks. @@ -1326,7 +1326,7 @@ pub struct Iter<'a, K: 'a, V: 'a> { inner: table::Iter<'a, K, V> } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, K, V> Clone for Iter<'a, K, V> { fn clone(&self) -> Iter<'a, K, V> { Iter { @@ -1358,7 +1358,7 @@ pub struct Keys<'a, K: 'a, V: 'a> { inner: Map<(&'a K, &'a V), &'a K, Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a K> } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, K, V> Clone for Keys<'a, K, V> { fn clone(&self) -> Keys<'a, K, V> { Keys { @@ -1373,7 +1373,7 @@ pub struct Values<'a, K: 'a, V: 'a> { inner: Map<(&'a K, &'a V), &'a V, Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a V> } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, K, V> Clone for Values<'a, K, V> { fn clone(&self) -> Values<'a, K, V> { Values { @@ -1578,7 +1578,7 @@ mod test_map { thread_local! { static DROP_VECTOR: RefCell> = RefCell::new(Vec::new()) } - #[deriving(Hash, PartialEq, Eq)] + #[derive(Hash, PartialEq, Eq)] struct Dropable { k: uint } diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index 74fb63a7a9e12..be74e53f4b88a 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -71,7 +71,7 @@ use super::map::{mod, HashMap, Keys, INITIAL_CAPACITY}; /// /// ``` /// use std::collections::HashSet; -/// #[deriving(Hash, Eq, PartialEq, Show)] +/// #[derive(Hash, Eq, PartialEq, Show)] /// struct Viking<'a> { /// name: &'a str, /// power: uint, @@ -89,7 +89,7 @@ use super::map::{mod, HashMap, Keys, INITIAL_CAPACITY}; /// println!("{}", x); /// } /// ``` -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct HashSet { map: HashMap diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 6938ab9b0b6d7..b524c00a52236 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -124,7 +124,7 @@ struct GapThenFull { /// A hash that is not zero, since we use a hash of zero to represent empty /// buckets. -#[deriving(PartialEq, Copy)] +#[derive(PartialEq, Copy)] pub struct SafeHash { hash: u64, } @@ -718,7 +718,7 @@ struct RawBuckets<'a, K, V> { marker: marker::ContravariantLifetime<'a>, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, K, V> Clone for RawBuckets<'a, K, V> { fn clone(&self) -> RawBuckets<'a, K, V> { RawBuckets { @@ -787,7 +787,7 @@ pub struct Iter<'a, K: 'a, V: 'a> { elems_left: uint, } -// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` impl<'a, K, V> Clone for Iter<'a, K, V> { fn clone(&self) -> Iter<'a, K, V> { Iter { diff --git a/src/libstd/comm/blocking.rs b/src/libstd/comm/blocking.rs index 412b7161305e6..02f12ca2d1e75 100644 --- a/src/libstd/comm/blocking.rs +++ b/src/libstd/comm/blocking.rs @@ -26,7 +26,7 @@ struct Inner { unsafe impl Send for Inner {} unsafe impl Sync for Inner {} -#[deriving(Clone)] +#[derive(Clone)] pub struct SignalToken { inner: Arc, } diff --git a/src/libstd/comm/mod.rs b/src/libstd/comm/mod.rs index a405627aecc45..0bcb5a21ae66b 100644 --- a/src/libstd/comm/mod.rs +++ b/src/libstd/comm/mod.rs @@ -394,7 +394,7 @@ pub struct SyncSender { /// This enumeration is the list of the possible reasons that try_recv could not /// return data when called. -#[deriving(PartialEq, Clone, Copy, Show)] +#[derive(PartialEq, Clone, Copy, Show)] #[experimental = "this is likely to be removed in changing try_recv()"] pub enum TryRecvError { /// This channel is currently empty, but the sender(s) have not yet @@ -407,7 +407,7 @@ pub enum TryRecvError { /// This enumeration is the list of the possible error outcomes for the /// `SyncSender::try_send` method. -#[deriving(PartialEq, Clone, Show)] +#[derive(PartialEq, Clone, Show)] #[experimental = "this is likely to be removed in changing try_send()"] pub enum TrySendError { /// The data could not be sent on the channel because it would require that diff --git a/src/libstd/comm/select.rs b/src/libstd/comm/select.rs index 690b5861c2239..9ec11acc643fe 100644 --- a/src/libstd/comm/select.rs +++ b/src/libstd/comm/select.rs @@ -92,7 +92,7 @@ pub struct Handle<'rx, T:'rx> { struct Packets { cur: *mut Handle<'static, ()> } #[doc(hidden)] -#[deriving(PartialEq)] +#[derive(PartialEq)] pub enum StartResult { Installed, Abort, diff --git a/src/libstd/comm/sync.rs b/src/libstd/comm/sync.rs index a8004155af06d..993a2b78ea709 100644 --- a/src/libstd/comm/sync.rs +++ b/src/libstd/comm/sync.rs @@ -103,7 +103,7 @@ struct Buffer { size: uint, } -#[deriving(Show)] +#[derive(Show)] pub enum Failure { Empty, Disconnected, diff --git a/src/libstd/dynamic_lib.rs b/src/libstd/dynamic_lib.rs index 368abe7cb1244..38dd8a9a7c8ba 100644 --- a/src/libstd/dynamic_lib.rs +++ b/src/libstd/dynamic_lib.rs @@ -250,7 +250,7 @@ pub mod dl { dlclose(handle as *mut libc::c_void); () } - #[deriving(Copy)] + #[derive(Copy)] pub enum Rtld { Lazy = 1, Now = 2, diff --git a/src/libstd/hash.rs b/src/libstd/hash.rs index 737fef23c7466..cdd0e9bf76f86 100644 --- a/src/libstd/hash.rs +++ b/src/libstd/hash.rs @@ -11,7 +11,7 @@ //! Generic hashing support. //! //! This module provides a generic way to compute the hash of a value. The -//! simplest way to make a type hashable is to use `#[deriving(Hash)]`: +//! simplest way to make a type hashable is to use `#[derive(Hash)]`: //! //! # Example //! @@ -19,7 +19,7 @@ //! use std::hash; //! use std::hash::Hash; //! -//! #[deriving(Hash)] +//! #[derive(Hash)] //! struct Person { //! id: uint, //! name: String, @@ -70,7 +70,7 @@ use rand; /// `RandomSipHasher` computes the SipHash algorithm from a stream of bytes /// initialized with random keys. -#[deriving(Clone)] +#[derive(Clone)] pub struct RandomSipHasher { hasher: sip::SipHasher, } diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index c5405601048ce..bc5dad54abb2a 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -419,7 +419,7 @@ mod test { /// A type, free to create, primarily intended for benchmarking creation of /// wrappers that, just for construction, don't need a Reader/Writer that /// does anything useful. Is equivalent to `/dev/null` in semantics. - #[deriving(Clone,PartialEq,PartialOrd)] + #[derive(Clone,PartialEq,PartialOrd)] pub struct NullStream; impl Reader for NullStream { diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs index 7fa6ebc6e3bac..47fef78fc79aa 100644 --- a/src/libstd/io/fs.rs +++ b/src/libstd/io/fs.rs @@ -558,7 +558,7 @@ pub fn walk_dir(path: &Path) -> IoResult { } /// An iterator that walks over a directory -#[deriving(Clone)] +#[derive(Clone)] pub struct Directories { stack: Vec, } diff --git a/src/libstd/io/mem.rs b/src/libstd/io/mem.rs index f8ea373f8f456..1f5f7490e153d 100644 --- a/src/libstd/io/mem.rs +++ b/src/libstd/io/mem.rs @@ -65,7 +65,7 @@ impl Writer for Vec { /// assert_eq!(w.into_inner(), vec!(0, 1, 2)); /// ``` #[deprecated = "use the Vec Writer implementation directly"] -#[deriving(Clone)] +#[derive(Clone)] pub struct MemWriter { buf: Vec, } diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index e8b852ee492b9..869de22232246 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -300,7 +300,7 @@ pub type IoResult = Result; /// # FIXME /// /// Is something like this sufficient? It's kind of archaic -#[deriving(PartialEq, Eq, Clone)] +#[derive(PartialEq, Eq, Clone)] pub struct IoError { /// An enumeration which can be matched against for determining the flavor /// of error. @@ -367,7 +367,7 @@ impl FromError for Box { } /// A list specifying general categories of I/O error. -#[deriving(Copy, PartialEq, Eq, Clone, Show)] +#[derive(Copy, PartialEq, Eq, Clone, Show)] pub enum IoErrorKind { /// Any I/O error not part of this list. OtherIoError, @@ -1560,7 +1560,7 @@ impl BufferPrelude for T { /// When seeking, the resulting cursor is offset from a base by the offset given /// to the `seek` function. The base used is specified by this enumeration. -#[deriving(Copy)] +#[derive(Copy)] pub enum SeekStyle { /// Seek from the beginning of the stream SeekSet, @@ -1683,7 +1683,7 @@ pub fn standard_error(kind: IoErrorKind) -> IoError { /// A mode specifies how a file should be opened or created. These modes are /// passed to `File::open_mode` and are used to control where the file is /// positioned when it is initially opened. -#[deriving(Copy, Clone, PartialEq, Eq)] +#[derive(Copy, Clone, PartialEq, Eq)] pub enum FileMode { /// Opens a file positioned at the beginning. Open, @@ -1695,7 +1695,7 @@ pub enum FileMode { /// Access permissions with which the file should be opened. `File`s /// opened with `Read` will return an error if written to. -#[deriving(Copy, Clone, PartialEq, Eq)] +#[derive(Copy, Clone, PartialEq, Eq)] pub enum FileAccess { /// Read-only access, requests to write will result in an error Read, @@ -1706,7 +1706,7 @@ pub enum FileAccess { } /// Different kinds of files which can be identified by a call to stat -#[deriving(Copy, PartialEq, Show, Hash, Clone)] +#[derive(Copy, PartialEq, Show, Hash, Clone)] pub enum FileType { /// This is a normal file, corresponding to `S_IFREG` RegularFile, @@ -1744,7 +1744,7 @@ pub enum FileType { /// println!("byte size: {}", info.size); /// # } /// ``` -#[deriving(Copy, Hash)] +#[derive(Copy, Hash)] pub struct FileStat { /// The size of the file, in bytes pub size: u64, @@ -1783,7 +1783,7 @@ pub struct FileStat { /// structure. This information is not necessarily platform independent, and may /// have different meanings or no meaning at all on some platforms. #[unstable] -#[deriving(Copy, Hash)] +#[derive(Copy, Hash)] pub struct UnstableFileStat { /// The ID of the device containing the file. pub device: u64, @@ -1922,7 +1922,7 @@ mod tests { use prelude::{Ok, Vec, Buffer, CloneSliceExt}; use uint; - #[deriving(Clone, PartialEq, Show)] + #[derive(Clone, PartialEq, Show)] enum BadReaderBehavior { GoodBehavior(uint), BadBehavior(uint) diff --git a/src/libstd/io/net/addrinfo.rs b/src/libstd/io/net/addrinfo.rs index e8fbb12118199..fdfc33c0300c6 100644 --- a/src/libstd/io/net/addrinfo.rs +++ b/src/libstd/io/net/addrinfo.rs @@ -29,7 +29,7 @@ use sys; use vec::Vec; /// Hints to the types of sockets that are desired when looking up hosts -#[deriving(Copy)] +#[derive(Copy)] pub enum SocketType { Stream, Datagram, Raw } @@ -38,7 +38,7 @@ pub enum SocketType { /// to manipulate how a query is performed. /// /// The meaning of each of these flags can be found with `man -s 3 getaddrinfo` -#[deriving(Copy)] +#[derive(Copy)] pub enum Flag { AddrConfig, All, @@ -51,7 +51,7 @@ pub enum Flag { /// A transport protocol associated with either a hint or a return value of /// `lookup` -#[deriving(Copy)] +#[derive(Copy)] pub enum Protocol { TCP, UDP } @@ -61,7 +61,7 @@ pub enum Protocol { /// /// For details on these fields, see their corresponding definitions via /// `man -s 3 getaddrinfo` -#[deriving(Copy)] +#[derive(Copy)] pub struct Hint { pub family: uint, pub socktype: Option, @@ -69,7 +69,7 @@ pub struct Hint { pub flags: uint, } -#[deriving(Copy)] +#[derive(Copy)] pub struct Info { pub address: SocketAddr, pub family: uint, diff --git a/src/libstd/io/net/ip.rs b/src/libstd/io/net/ip.rs index 49ab9ddb92487..663c7a05ca837 100644 --- a/src/libstd/io/net/ip.rs +++ b/src/libstd/io/net/ip.rs @@ -31,7 +31,7 @@ use vec::Vec; pub type Port = u16; -#[deriving(Copy, PartialEq, Eq, Clone, Hash)] +#[derive(Copy, PartialEq, Eq, Clone, Hash)] pub enum IpAddr { Ipv4Addr(u8, u8, u8, u8), Ipv6Addr(u16, u16, u16, u16, u16, u16, u16, u16) @@ -62,7 +62,7 @@ impl fmt::Show for IpAddr { } } -#[deriving(Copy, PartialEq, Eq, Clone, Hash)] +#[derive(Copy, PartialEq, Eq, Clone, Hash)] pub struct SocketAddr { pub ip: IpAddr, pub port: Port, diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index b127507f048d2..8365a13b1e255 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -97,12 +97,12 @@ pub struct Process { /// A representation of environment variable name /// It compares case-insensitive on Windows and case-sensitive everywhere else. #[cfg(not(windows))] -#[deriving(PartialEq, Eq, Hash, Clone, Show)] +#[derive(PartialEq, Eq, Hash, Clone, Show)] struct EnvKey(CString); #[doc(hidden)] #[cfg(windows)] -#[deriving(Eq, Clone, Show)] +#[derive(Eq, Clone, Show)] struct EnvKey(CString); #[cfg(windows)] @@ -168,7 +168,7 @@ pub type EnvMap = HashMap; /// /// let output = process.stdout.as_mut().unwrap().read_to_end(); /// ``` -#[deriving(Clone)] +#[derive(Clone)] pub struct Command { // The internal data for the builder. Documented by the builder // methods below, and serialized into rt::rtio::ProcessConfig. @@ -450,7 +450,7 @@ impl sys::process::ProcessConfig for Command { } /// The output of a finished process. -#[deriving(PartialEq, Eq, Clone)] +#[derive(PartialEq, Eq, Clone)] pub struct ProcessOutput { /// The status (exit code) of the process. pub status: ProcessExit, @@ -461,7 +461,7 @@ pub struct ProcessOutput { } /// Describes what to do with a standard io stream for a child process. -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub enum StdioContainer { /// This stream will be ignored. This is the equivalent of attaching the /// stream to `/dev/null` @@ -483,7 +483,7 @@ pub enum StdioContainer { /// Describes the result of a process after it has terminated. /// Note that Windows have no signals, so the result is usually ExitStatus. -#[deriving(PartialEq, Eq, Clone, Copy)] +#[derive(PartialEq, Eq, Clone, Copy)] pub enum ProcessExit { /// Normal termination with an exit status. ExitStatus(int), diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index b7d069eb19e58..06f6a1bfbd9a3 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -104,7 +104,7 @@ unsafe impl Send for RaceBox {} unsafe impl Sync for RaceBox {} /// A synchronized wrapper around a buffered reader from stdin -#[deriving(Clone)] +#[derive(Clone)] pub struct StdinReader { inner: Arc>, } diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index 9840412160d9f..9cadcae784fc1 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -81,7 +81,7 @@ impl Buffer for LimitReader { } /// A `Writer` which ignores bytes written to it, like /dev/null. -#[deriving(Copy)] +#[derive(Copy)] pub struct NullWriter; impl Writer for NullWriter { @@ -90,7 +90,7 @@ impl Writer for NullWriter { } /// A `Reader` which returns an infinite stream of 0 bytes, like /dev/zero. -#[deriving(Copy)] +#[derive(Copy)] pub struct ZeroReader; impl Reader for ZeroReader { @@ -111,7 +111,7 @@ impl Buffer for ZeroReader { } /// A `Reader` which is always at EOF, like /dev/null. -#[deriving(Copy)] +#[derive(Copy)] pub struct NullReader; impl Reader for NullReader { @@ -163,7 +163,7 @@ impl Writer for MultiWriter { /// A `Reader` which chains input from multiple `Reader`s, reading each to /// completion before moving onto the next. -#[deriving(Clone)] +#[derive(Clone)] pub struct ChainedReader { readers: I, cur_reader: Option, @@ -247,7 +247,7 @@ pub fn copy(r: &mut R, w: &mut W) -> io::IoResult<()> { } /// An adaptor converting an `Iterator` to a `Reader`. -#[deriving(Clone)] +#[derive(Clone)] pub struct IterReader { iter: T, } diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index 48ff1a364e93c..8cdb90ee57189 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -729,7 +729,7 @@ mod tests { test_checked_next_power_of_two! { test_checked_next_power_of_two_u64, u64 } test_checked_next_power_of_two! { test_checked_next_power_of_two_uint, uint } - #[deriving(PartialEq, Show)] + #[derive(PartialEq, Show)] struct Value { x: int } impl ToPrimitive for Value { diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index febdf5f6118a5..dbd1af48856a1 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -26,7 +26,7 @@ use string::String; use vec::Vec; /// A flag that specifies whether to use exponential (scientific) notation. -#[deriving(Copy)] +#[derive(Copy)] pub enum ExponentFormat { /// Do not use exponential notation. ExpNone, @@ -41,7 +41,7 @@ pub enum ExponentFormat { /// The number of digits used for emitting the fractional part of a number, if /// any. -#[deriving(Copy)] +#[derive(Copy)] pub enum SignificantDigits { /// All calculable digits will be printed. /// @@ -58,7 +58,7 @@ pub enum SignificantDigits { } /// How to emit the sign of a number. -#[deriving(Copy)] +#[derive(Copy)] pub enum SignFormat { /// No sign will be printed. The exponent sign will also be emitted. SignNone, diff --git a/src/libstd/os.rs b/src/libstd/os.rs index df50b7f81afcf..a4fb6f0d271d5 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -362,7 +362,7 @@ pub fn join_paths(paths: &[T]) -> Result, &'static st } /// A low-level OS in-memory pipe. -#[deriving(Copy)] +#[derive(Copy)] pub struct Pipe { /// A file descriptor representing the reading end of the pipe. Data written /// on the `out` file descriptor can be read from this file descriptor. @@ -863,7 +863,7 @@ pub enum MapOption { impl Copy for MapOption {} /// Possible errors when creating a map. -#[deriving(Copy)] +#[derive(Copy)] pub enum MapError { /// # The following are POSIX-specific /// diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index bd4031e623085..0c2d7004681f4 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -36,7 +36,7 @@ pub type StrComponents<'a> = Map<&'a [u8], Option<&'a str>, Components<'a>, fn(&[u8]) -> Option<&str>>; /// Represents a POSIX file path -#[deriving(Clone)] +#[derive(Clone)] pub struct Path { repr: Vec, // assumed to never be empty or contain NULs sepidx: Option // index of the final separator in repr diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index 751ed4b70fb38..051635feb523e 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -78,7 +78,7 @@ pub type Components<'a> = // // The only error condition imposed here is valid utf-8. All other invalid paths are simply // preserved by the data structure; let the Windows API error out on them. -#[deriving(Clone)] +#[derive(Clone)] pub struct Path { repr: String, // assumed to never be empty prefix: Option, @@ -969,7 +969,7 @@ pub fn is_sep_byte_verbatim(u: &u8) -> bool { } /// Prefix types for Path -#[deriving(Copy, PartialEq, Clone, Show)] +#[derive(Copy, PartialEq, Clone, Show)] pub enum PathPrefix { /// Prefix `\\?\`, uint is the length of the following component VerbatimPrefix(uint), diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index f665d150f3878..faa7c1098c5d4 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -245,7 +245,7 @@ pub mod reader; /// The standard RNG. This is designed to be efficient on the current /// platform. -#[deriving(Copy)] +#[derive(Copy)] pub struct StdRng { rng: IsaacWordRng, } diff --git a/src/libstd/rt/libunwind.rs b/src/libstd/rt/libunwind.rs index 4dbe878277da3..f4108cbfdbfec 100644 --- a/src/libstd/rt/libunwind.rs +++ b/src/libstd/rt/libunwind.rs @@ -25,7 +25,7 @@ use libc; #[cfg(any(not(target_arch = "arm"), target_os = "ios"))] #[repr(C)] -#[deriving(Copy)] +#[derive(Copy)] pub enum _Unwind_Action { _UA_SEARCH_PHASE = 1, _UA_CLEANUP_PHASE = 2, diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 41e91d1b6ef9b..578629c29e79d 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -59,7 +59,7 @@ pub struct Task { // Once a thread has entered the `Armed` state it must be destroyed via `drop`, // and no other method. This state is used to track this transition. -#[deriving(PartialEq)] +#[derive(PartialEq)] enum TaskState { New, Armed, diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index e0c512706e6a9..c5163efa6fee3 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -396,7 +396,7 @@ pub mod eabi { pub struct DISPATCHER_CONTEXT; #[repr(C)] - #[deriving(Copy)] + #[derive(Copy)] pub enum EXCEPTION_DISPOSITION { ExceptionContinueExecution, ExceptionContinueSearch, diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 259c15b5f0634..9c59c85d611b3 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -31,7 +31,7 @@ use io; // FIXME: move uses of Arc and deadline tracking to std::io -#[deriving(Show)] +#[derive(Show)] pub enum SocketStatus { Readable, Writable, diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index a7b3ee996a34d..cb27ee68f1a6a 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -291,7 +291,7 @@ struct Inner { unsafe impl Sync for Inner {} -#[deriving(Clone)] +#[derive(Clone)] /// A handle to a thread. pub struct Thread { inner: Arc, diff --git a/src/libstd/time/duration.rs b/src/libstd/time/duration.rs index 51564b539768d..61f384c38f3da 100644 --- a/src/libstd/time/duration.rs +++ b/src/libstd/time/duration.rs @@ -46,7 +46,7 @@ macro_rules! try_opt { /// ISO 8601 time duration with nanosecond precision. /// This also allows for the negative duration; see individual methods for details. -#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct Duration { secs: i64, nanos: i32, // Always 0 <= nanos < NANOS_PER_SEC diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index b1599cb807d01..c366ced58b2a8 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -15,7 +15,7 @@ pub use self::AbiArchitecture::*; use std::fmt; -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Os { OsWindows, OsMacos, @@ -26,7 +26,7 @@ pub enum Os { OsDragonfly, } -#[deriving(PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Clone, Copy)] +#[derive(PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Clone, Copy)] pub enum Abi { // NB: This ordering MUST match the AbiDatas array below. // (This is ensured by the test indices_are_correct().) @@ -47,7 +47,7 @@ pub enum Abi { } #[allow(non_camel_case_types)] -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum Architecture { X86, X86_64, @@ -56,7 +56,7 @@ pub enum Architecture { Mipsel } -#[deriving(Copy)] +#[derive(Copy)] pub struct AbiData { abi: Abi, @@ -64,7 +64,7 @@ pub struct AbiData { name: &'static str, } -#[deriving(Copy)] +#[derive(Copy)] pub enum AbiArchitecture { /// Not a real ABI (e.g., intrinsic) RustArch, diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 12432c8c78f2c..4c54bed83ab60 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -79,7 +79,7 @@ use serialize::{Encodable, Decodable, Encoder, Decoder}; /// table) and a SyntaxContext to track renaming and /// macro expansion per Flatt et al., "Macros /// That Work Together" -#[deriving(Clone, Copy, Hash, PartialOrd, Eq, Ord)] +#[derive(Clone, Copy, Hash, PartialOrd, Eq, Ord)] pub struct Ident { pub name: Name, pub ctxt: SyntaxContext @@ -157,7 +157,7 @@ pub const ILLEGAL_CTXT : SyntaxContext = 1; /// A name is a part of an identifier, representing a string or gensym. It's /// the result of interning. -#[deriving(Eq, Ord, PartialEq, PartialOrd, Hash, +#[derive(Eq, Ord, PartialEq, PartialOrd, Hash, RustcEncodable, RustcDecodable, Clone, Copy)] pub struct Name(pub u32); @@ -197,7 +197,7 @@ impl, E> Decodable for Ident { /// Function name (not all functions have names) pub type FnIdent = Option; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub struct Lifetime { pub id: NodeId, @@ -205,7 +205,7 @@ pub struct Lifetime { pub name: Name } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct LifetimeDef { pub lifetime: Lifetime, pub bounds: Vec @@ -214,7 +214,7 @@ pub struct LifetimeDef { /// A "Path" is essentially Rust's notion of a name; for instance: /// std::cmp::PartialEq . It's represented as a sequence of identifiers, /// along with a bunch of supporting information. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Path { pub span: Span, /// A `::foo` path, is relative to the crate root rather than current @@ -226,7 +226,7 @@ pub struct Path { /// A segment of a path: an identifier, an optional lifetime, and a set of /// types. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct PathSegment { /// The identifier portion of this path segment. pub identifier: Ident, @@ -239,7 +239,7 @@ pub struct PathSegment { pub parameters: PathParameters, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum PathParameters { AngleBracketedParameters(AngleBracketedParameterData), ParenthesizedParameters(ParenthesizedParameterData), @@ -317,7 +317,7 @@ impl PathParameters { } /// A path like `Foo<'a, T>` -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct AngleBracketedParameterData { /// The lifetime parameters for this path segment. pub lifetimes: Vec, @@ -335,7 +335,7 @@ impl AngleBracketedParameterData { } /// A path like `Foo(A,B) -> C` -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ParenthesizedParameterData { /// `(A,B)` pub inputs: Vec>, @@ -348,7 +348,7 @@ pub type CrateNum = u32; pub type NodeId = u32; -#[deriving(Clone, Eq, Ord, PartialOrd, PartialEq, RustcEncodable, +#[derive(Clone, Eq, Ord, PartialOrd, PartialEq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub struct DefId { pub krate: CrateNum, @@ -369,7 +369,7 @@ pub const DUMMY_NODE_ID: NodeId = -1; /// typeck::collect::compute_bounds matches these against /// the "special" built-in traits (see middle::lang_items) and /// detects Copy, Send and Sync. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum TyParamBound { TraitTyParamBound(PolyTraitRef, TraitBoundModifier), RegionTyParamBound(Lifetime) @@ -377,7 +377,7 @@ pub enum TyParamBound { /// A modifier on a bound, currently this is only used for `?Sized`, where the /// modifier is `Maybe`. Negative bounds should also be handled here. -#[deriving(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum TraitBoundModifier { None, Maybe, @@ -385,7 +385,7 @@ pub enum TraitBoundModifier { pub type TyParamBounds = OwnedSlice; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TyParam { pub ident: Ident, pub id: NodeId, @@ -396,7 +396,7 @@ pub struct TyParam { /// Represents lifetimes and type parameters attached to a declaration /// of a function, enum, trait, etc. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Generics { pub lifetimes: Vec, pub ty_params: OwnedSlice, @@ -415,34 +415,34 @@ impl Generics { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct WhereClause { pub id: NodeId, pub predicates: Vec, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum WherePredicate { BoundPredicate(WhereBoundPredicate), RegionPredicate(WhereRegionPredicate), EqPredicate(WhereEqPredicate) } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct WhereBoundPredicate { pub span: Span, pub bounded_ty: P, pub bounds: OwnedSlice, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct WhereRegionPredicate { pub span: Span, pub lifetime: Lifetime, pub bounds: Vec, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct WhereEqPredicate { pub id: NodeId, pub span: Span, @@ -454,7 +454,7 @@ pub struct WhereEqPredicate { /// used to drive conditional compilation pub type CrateConfig = Vec> ; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Crate { pub module: Mod, pub attrs: Vec, @@ -465,7 +465,7 @@ pub struct Crate { pub type MetaItem = Spanned; -#[deriving(Clone, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum MetaItem_ { MetaWord(InternedString), MetaList(InternedString, Vec>), @@ -497,7 +497,7 @@ impl PartialEq for MetaItem_ { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Block { pub view_items: Vec, pub stmts: Vec>, @@ -507,27 +507,27 @@ pub struct Block { pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Pat { pub id: NodeId, pub node: Pat_, pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct FieldPat { pub ident: Ident, pub pat: P, pub is_shorthand: bool, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum BindingMode { BindByRef(Mutability), BindByValue(Mutability), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum PatWildKind { /// Represents the wildcard pattern `_` PatWildSingle, @@ -536,7 +536,7 @@ pub enum PatWildKind { PatWildMulti, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Pat_ { /// Represents a wildcard pattern (either `_` or `..`) PatWild(PatWildKind), @@ -565,13 +565,13 @@ pub enum Pat_ { PatMac(Mac), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum Mutability { MutMutable, MutImmutable, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum BinOp { BiAdd, BiSub, @@ -593,7 +593,7 @@ pub enum BinOp { BiGt, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum UnOp { UnUniq, UnDeref, @@ -603,7 +603,7 @@ pub enum UnOp { pub type Stmt = Spanned; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Stmt_ { /// Could be an item or a local (let) binding: StmtDecl(P, NodeId), @@ -617,7 +617,7 @@ pub enum Stmt_ { StmtMac(P, MacStmtStyle), } -#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum MacStmtStyle { /// The macro statement had a trailing semicolon, e.g. `foo! { ... };` /// `foo!(...);`, `foo![...];` @@ -632,7 +632,7 @@ pub enum MacStmtStyle { /// Where a local declaration came from: either a true `let ... = /// ...;`, or one desugared from the pattern of a for loop. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum LocalSource { LocalLet, LocalFor, @@ -641,7 +641,7 @@ pub enum LocalSource { // FIXME (pending discussion of #1697, #2178...): local should really be // a refinement on pat. /// Local represents a `let` statement, e.g., `let : = ;` -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Local { pub ty: P, pub pat: P, @@ -653,7 +653,7 @@ pub struct Local { pub type Decl = Spanned; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Decl_ { /// A local (let) binding: DeclLocal(P), @@ -662,7 +662,7 @@ pub enum Decl_ { } /// represents one arm of a 'match' -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Arm { pub attrs: Vec, pub pats: Vec>, @@ -670,7 +670,7 @@ pub struct Arm { pub body: P, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Field { pub ident: SpannedIdent, pub expr: P, @@ -679,26 +679,26 @@ pub struct Field { pub type SpannedIdent = Spanned; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum BlockCheckMode { DefaultBlock, UnsafeBlock(UnsafeSource), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum UnsafeSource { CompilerGenerated, UserProvided, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Expr { pub id: NodeId, pub node: Expr_, pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Expr_ { /// First expr is the place; second expr is the value. ExprBox(Option>, P), @@ -760,28 +760,28 @@ pub enum Expr_ { /// as SomeTrait>::SomeAssociatedItem /// ^~~~~ ^~~~~~~~~ ^~~~~~~~~~~~~~~~~~ /// self_type trait_name item_name -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct QPath { pub self_type: P, pub trait_ref: P, pub item_name: Ident, // FIXME(#20301) -- should use Name } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum MatchSource { Normal, IfLetDesugar { contains_else_clause: bool }, WhileLetDesugar, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum CaptureClause { CaptureByValue, CaptureByRef, } /// A delimited sequence of token trees -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Delimited { /// The type of delimiter pub delim: token::DelimToken, @@ -816,7 +816,7 @@ impl Delimited { } /// A sequence of token treesee -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct SequenceRepetition { /// The sequence of token trees pub tts: Vec, @@ -830,7 +830,7 @@ pub struct SequenceRepetition { /// A Kleene-style [repetition operator](http://en.wikipedia.org/wiki/Kleene_star) /// for token sequences. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum KleeneOp { ZeroOrMore, OneOrMore, @@ -848,7 +848,7 @@ pub enum KleeneOp { /// /// The RHS of an MBE macro is the only place `SubstNt`s are substituted. /// Nothing special happens to misnamed or misplaced `SubstNt`s. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] #[doc="For macro invocations; parsing is delegated to the macro"] pub enum TokenTree { /// A single token @@ -938,14 +938,14 @@ pub type Mac = Spanned; /// is being invoked, and the vector of token-trees contains the source /// of the macro invocation. /// There's only one flavor, now, so this could presumably be simplified. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Mac_ { // NB: the additional ident for a macro_rules-style macro is actually // stored in the enclosing item. Oog. MacInvocTT(Path, Vec , SyntaxContext), // new macro-invocation } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum StrStyle { CookedStr, RawStr(uint) @@ -953,7 +953,7 @@ pub enum StrStyle { pub type Lit = Spanned; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum Sign { Minus, Plus @@ -969,7 +969,7 @@ impl Sign where T: Int { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum LitIntType { SignedIntLit(IntTy, Sign), UnsignedIntLit(UintTy), @@ -986,7 +986,7 @@ impl LitIntType { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Lit_ { LitStr(InternedString, StrStyle), LitBinary(Rc >), @@ -1000,13 +1000,13 @@ pub enum Lit_ { // NB: If you change this, you'll probably want to change the corresponding // type structure in middle/ty.rs as well. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct MutTy { pub ty: P, pub mutbl: Mutability, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TypeField { pub ident: Ident, pub mt: MutTy, @@ -1015,7 +1015,7 @@ pub struct TypeField { /// Represents a required method in a trait declaration, /// one without a default implementation -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TypeMethod { pub ident: Ident, pub attrs: Vec, @@ -1033,26 +1033,26 @@ pub struct TypeMethod { /// a default implementation A trait method is either required (meaning it /// doesn't have an implementation, just a signature) or provided (meaning it /// has a default implementation). -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum TraitItem { RequiredMethod(TypeMethod), ProvidedMethod(P), TypeTraitItem(P), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ImplItem { MethodImplItem(P), TypeImplItem(P), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct AssociatedType { pub attrs: Vec, pub ty_param: TyParam, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Typedef { pub id: NodeId, pub span: Span, @@ -1062,7 +1062,7 @@ pub struct Typedef { pub typ: P, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum IntTy { TyI, TyI8, @@ -1087,7 +1087,7 @@ impl IntTy { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum UintTy { TyU, TyU8, @@ -1112,7 +1112,7 @@ impl fmt::Show for UintTy { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum FloatTy { TyF32, TyF64, @@ -1133,7 +1133,7 @@ impl FloatTy { } // Bind a type to an associated type: `A=Foo`. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TypeBinding { pub id: NodeId, pub ident: Ident, @@ -1143,7 +1143,7 @@ pub struct TypeBinding { // NB PartialEq method appears below. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Ty { pub id: NodeId, pub node: Ty_, @@ -1151,7 +1151,7 @@ pub struct Ty { } /// Not represented directly in the AST, referred to by name through a ty_path. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum PrimTy { TyInt(IntTy), TyUint(UintTy), @@ -1161,7 +1161,7 @@ pub enum PrimTy { TyChar } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] pub enum Onceness { Once, Many @@ -1177,7 +1177,7 @@ impl fmt::Show for Onceness { } /// Represents the type of a closure -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ClosureTy { pub lifetimes: Vec, pub unsafety: Unsafety, @@ -1186,7 +1186,7 @@ pub struct ClosureTy { pub bounds: TyParamBounds, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct BareFnTy { pub unsafety: Unsafety, pub abi: Abi, @@ -1194,7 +1194,7 @@ pub struct BareFnTy { pub decl: P } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] /// The different kinds of types recognized by the compiler pub enum Ty_ { TyVec(P), @@ -1229,13 +1229,13 @@ pub enum Ty_ { TyInfer, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum AsmDialect { AsmAtt, AsmIntel } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct InlineAsm { pub asm: InternedString, pub asm_str_style: StrStyle, @@ -1249,7 +1249,7 @@ pub struct InlineAsm { } /// represents an argument in a function header -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Arg { pub ty: P, pub pat: P, @@ -1277,14 +1277,14 @@ impl Arg { } /// represents the header (not the body) of a function declaration -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct FnDecl { pub inputs: Vec, pub output: FunctionRetTy, pub variadic: bool } -#[deriving(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)] +#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)] pub enum Unsafety { Unsafe, Normal, @@ -1299,7 +1299,7 @@ impl fmt::Show for Unsafety { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum FunctionRetTy { /// Functions with return type ! that always /// raise an error or exit (i.e. never return to the caller) @@ -1318,7 +1318,7 @@ impl FunctionRetTy { } /// Represents the kind of 'self' associated with a method -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ExplicitSelf_ { /// No self SelfStatic, @@ -1332,7 +1332,7 @@ pub enum ExplicitSelf_ { pub type ExplicitSelf = Spanned; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Method { pub attrs: Vec, pub id: NodeId, @@ -1340,7 +1340,7 @@ pub struct Method { pub node: Method_, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Method_ { /// Represents a method declaration MethDecl(Ident, @@ -1355,7 +1355,7 @@ pub enum Method_ { MethMac(Mac), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Mod { /// A span from the first token past `{` to the last token until `}`. /// For `mod foo;`, the inner span ranges from the first token @@ -1365,31 +1365,31 @@ pub struct Mod { pub items: Vec>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ForeignMod { pub abi: Abi, pub view_items: Vec, pub items: Vec>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct VariantArg { pub ty: P, pub id: NodeId, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum VariantKind { TupleVariantKind(Vec), StructVariantKind(P), } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct EnumDef { pub variants: Vec>, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Variant_ { pub name: Ident, pub attrs: Vec, @@ -1401,7 +1401,7 @@ pub struct Variant_ { pub type Variant = Spanned; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum PathListItem_ { PathListIdent { name: Ident, id: NodeId }, PathListMod { id: NodeId } @@ -1419,7 +1419,7 @@ pub type PathListItem = Spanned; pub type ViewPath = Spanned; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ViewPath_ { /// `foo::bar::baz as quux` @@ -1436,7 +1436,7 @@ pub enum ViewPath_ { ViewPathList(Path, Vec , NodeId) } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ViewItem { pub node: ViewItem_, pub attrs: Vec, @@ -1444,7 +1444,7 @@ pub struct ViewItem { pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ViewItem_ { /// Ident: name used to refer to this crate in the code /// optional (InternedString,StrStyle): if present, this is a location @@ -1460,17 +1460,17 @@ pub type Attribute = Spanned; /// Distinguishes between Attributes that decorate items and Attributes that /// are contained as statements within items. These two cases need to be /// distinguished for pretty-printing. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum AttrStyle { AttrOuter, AttrInner, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub struct AttrId(pub uint); /// Doc-comments are promoted to attributes that have is_sugared_doc = true -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Attribute_ { pub id: AttrId, pub style: AttrStyle, @@ -1483,13 +1483,13 @@ pub struct Attribute_ { /// that the ref_id is for. The impl_id maps to the "self type" of this impl. /// If this impl is an ItemImpl, the impl_id is redundant (it could be the /// same as the impl's node id). -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct TraitRef { pub path: Path, pub ref_id: NodeId, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct PolyTraitRef { /// The `'a` in `<'a> Foo<&'a T>` pub bound_lifetimes: Vec, @@ -1498,7 +1498,7 @@ pub struct PolyTraitRef { pub trait_ref: TraitRef, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum Visibility { Public, Inherited, @@ -1513,7 +1513,7 @@ impl Visibility { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct StructField_ { pub kind: StructFieldKind, pub id: NodeId, @@ -1532,7 +1532,7 @@ impl StructField_ { pub type StructField = Spanned; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum StructFieldKind { NamedField(Ident, Visibility), /// Element of a tuple-like struct @@ -1548,7 +1548,7 @@ impl StructFieldKind { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct StructDef { /// Fields, not including ctor pub fields: Vec, @@ -1561,7 +1561,7 @@ pub struct StructDef { FIXME (#3300): Should allow items to be anonymous. Right now we just use dummy names for anon items. */ -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct Item { pub ident: Ident, pub attrs: Vec, @@ -1571,7 +1571,7 @@ pub struct Item { pub span: Span, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum Item_ { ItemStatic(P, Mutability, P), ItemConst(P, P), @@ -1613,7 +1613,7 @@ impl Item_ { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub struct ForeignItem { pub ident: Ident, pub attrs: Vec, @@ -1623,7 +1623,7 @@ pub struct ForeignItem { pub vis: Visibility, } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum ForeignItem_ { ForeignItemFn(P, Generics), ForeignItemStatic(P, /* is_mutbl */ bool), @@ -1638,7 +1638,7 @@ impl ForeignItem_ { } } -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum UnboxedClosureKind { FnUnboxedClosureKind, FnMutUnboxedClosureKind, @@ -1648,7 +1648,7 @@ pub enum UnboxedClosureKind { /// The data we save and restore about an inlined item or method. This is not /// part of the AST that we parse from a file, but it becomes part of the tree /// that we trans. -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)] pub enum InlinedItem { IIItem(P), IITraitItem(DefId /* impl id */, TraitItem), diff --git a/src/libsyntax/ast_map/blocks.rs b/src/libsyntax/ast_map/blocks.rs index 7c89245f53ef7..53787d71eef80 100644 --- a/src/libsyntax/ast_map/blocks.rs +++ b/src/libsyntax/ast_map/blocks.rs @@ -41,7 +41,7 @@ use visit; /// - The default implementation for a trait method. /// /// To construct one, use the `Code::from_node` function. -#[deriving(Copy)] +#[derive(Copy)] pub struct FnLikeNode<'a> { node: ast_map::Node<'a> } /// MaybeFnLike wraps a method that indicates if an object @@ -81,7 +81,7 @@ impl MaybeFnLike for ast::Expr { /// Carries either an FnLikeNode or a Block, as these are the two /// constructs that correspond to "code" (as in, something from which /// we can construct a control-flow graph). -#[deriving(Copy)] +#[derive(Copy)] pub enum Code<'a> { FnLikeCode(FnLikeNode<'a>), BlockCode(&'a Block), diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index b5395d09ca7d4..7d249c6efcc97 100644 --- a/src/libsyntax/ast_map/mod.rs +++ b/src/libsyntax/ast_map/mod.rs @@ -32,7 +32,7 @@ use std::slice; pub mod blocks; -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum PathElem { PathMod(Name), PathName(Name) @@ -53,7 +53,7 @@ impl fmt::Show for PathElem { } } -#[deriving(Clone)] +#[derive(Clone)] struct LinkedPathNode<'a> { node: PathElem, next: LinkedPath<'a>, @@ -74,7 +74,7 @@ impl<'a> Iterator for LinkedPath<'a> { } // HACK(eddyb) move this into libstd (value wrapper for slice::Iter). -#[deriving(Clone)] +#[derive(Clone)] pub struct Values<'a, T:'a>(pub slice::Iter<'a, T>); impl<'a, T: Copy> Iterator for Values<'a, T> { @@ -100,7 +100,7 @@ pub fn path_to_string>(path: PI) -> String { }).to_string() } -#[deriving(Copy, Show)] +#[derive(Copy, Show)] pub enum Node<'ast> { NodeItem(&'ast Item), NodeForeignItem(&'ast ForeignItem), @@ -122,7 +122,7 @@ pub enum Node<'ast> { /// Represents an entry and its parent Node ID /// The odd layout is to bring down the total size. -#[deriving(Copy, Show)] +#[derive(Copy, Show)] enum MapEntry<'ast> { /// Placeholder for holes in the map. NotPresent, @@ -153,7 +153,7 @@ impl<'ast> Clone for MapEntry<'ast> { } } -#[deriving(Show)] +#[derive(Show)] struct InlinedParent { path: Vec, ii: InlinedItem diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index a8393ed9d3977..4026da6cf8e47 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -343,7 +343,7 @@ pub fn empty_generics() -> Generics { // ______________________________________________________________________ // Enumerating the IDs which appear in an AST -#[deriving(RustcEncodable, RustcDecodable, Show, Copy)] +#[derive(RustcEncodable, RustcDecodable, Show, Copy)] pub struct IdRange { pub min: NodeId, pub max: NodeId, diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index df820b40cb6de..ea53502c290b8 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -277,7 +277,7 @@ pub fn find_crate_name(attrs: &[Attribute]) -> Option { first_attr_value_str_by_name(attrs, "crate_name") } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum InlineAttr { InlineNone, InlineHint, @@ -340,14 +340,14 @@ pub fn cfg_matches(diagnostic: &SpanHandler, cfgs: &[P], cfg: &ast::Me } /// Represents the #[deprecated="foo"] and friends attributes. -#[deriving(RustcEncodable,RustcDecodable,Clone,Show)] +#[derive(RustcEncodable,RustcDecodable,Clone,Show)] pub struct Stability { pub level: StabilityLevel, pub text: Option } /// The available stability levels. -#[deriving(RustcEncodable,RustcDecodable,PartialEq,PartialOrd,Clone,Show,Copy)] +#[derive(RustcEncodable,RustcDecodable,PartialEq,PartialOrd,Clone,Show,Copy)] pub enum StabilityLevel { Deprecated, Experimental, @@ -463,7 +463,7 @@ fn int_type_of_word(s: &str) -> Option { } } -#[deriving(PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] +#[derive(PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] pub enum ReprAttr { ReprAny, ReprInt(Span, IntType), @@ -482,7 +482,7 @@ impl ReprAttr { } } -#[deriving(Eq, Hash, PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] +#[derive(Eq, Hash, PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] pub enum IntType { SignedInt(ast::IntTy), UnsignedInt(ast::UintTy) diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index e61afb8b193af..64f2e5ea79bcd 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -31,13 +31,13 @@ pub trait Pos { /// A byte offset. Keep this small (currently 32-bits), as AST contains /// a lot of them. -#[deriving(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Show)] pub struct BytePos(pub u32); /// A character offset. Because of multibyte utf8 characters, a byte offset /// is not equivalent to a character offset. The CodeMap will convert BytePos /// values to CharPos values as necessary. -#[deriving(Copy, PartialEq, Hash, PartialOrd, Show)] +#[derive(Copy, PartialEq, Hash, PartialOrd, Show)] pub struct CharPos(pub uint); // FIXME: Lots of boilerplate in these impls, but so far my attempts to fix @@ -81,7 +81,7 @@ impl Sub for CharPos { /// are *absolute* positions from the beginning of the codemap, not positions /// relative to FileMaps. Methods on the CodeMap can be used to relate spans back /// to the original source. -#[deriving(Clone, Copy, Show, Hash)] +#[derive(Clone, Copy, Show, Hash)] pub struct Span { pub lo: BytePos, pub hi: BytePos, @@ -92,7 +92,7 @@ pub struct Span { pub const DUMMY_SP: Span = Span { lo: BytePos(0), hi: BytePos(0), expn_id: NO_EXPANSION }; -#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub struct Spanned { pub node: T, pub span: Span, @@ -175,15 +175,15 @@ pub struct FileMapAndLine { pub fm: Rc, pub line: uint } pub struct FileMapAndBytePos { pub fm: Rc, pub pos: BytePos } /// The syntax with which a macro was invoked. -#[deriving(Clone, Copy, Hash, Show)] +#[derive(Clone, Copy, Hash, Show)] pub enum MacroFormat { - /// e.g. #[deriving(...)] + /// e.g. #[derive(...)] MacroAttribute, /// e.g. `format!()` MacroBang } -#[deriving(Clone, Hash, Show)] +#[derive(Clone, Hash, Show)] pub struct NameAndSpan { /// The name of the macro that was invoked to create the thing /// with this Span. @@ -197,7 +197,7 @@ pub struct NameAndSpan { } /// Extra information for tracking macro expansion of spans -#[deriving(Hash, Show)] +#[derive(Hash, Show)] pub struct ExpnInfo { /// The location of the actual macro invocation, e.g. `let x = /// foo!();` @@ -218,7 +218,7 @@ pub struct ExpnInfo { pub callee: NameAndSpan } -#[deriving(PartialEq, Eq, Clone, Show, Hash, RustcEncodable, RustcDecodable, Copy)] +#[derive(PartialEq, Eq, Clone, Show, Hash, RustcEncodable, RustcDecodable, Copy)] pub struct ExpnId(u32); pub const NO_EXPANSION: ExpnId = ExpnId(-1); @@ -242,7 +242,7 @@ pub struct FileLines { } /// Identifies an offset of a multi-byte character in a FileMap -#[deriving(Copy)] +#[derive(Copy)] pub struct MultiByteChar { /// The absolute offset of the character in the CodeMap pub pos: BytePos, diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 88dfdf6e2d8f6..c19c06c315587 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -28,7 +28,7 @@ use term; /// maximum number of lines we will print for each error; arbitrary. static MAX_LINES: uint = 6u; -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub enum RenderSpan { /// A FullSpan renders with both with an initial line for the /// message, prefixed by file:linenum, followed by a summary of @@ -54,7 +54,7 @@ impl RenderSpan { } } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub enum ColorConfig { Auto, Always, @@ -71,12 +71,12 @@ pub trait Emitter { /// This structure is used to signify that a task has panicked with a fatal error /// from the diagnostics. You can use this with the `Any` trait to figure out /// how a rustc task died (if so desired). -#[deriving(Copy)] +#[derive(Copy)] pub struct FatalError; /// Signifies that the compiler died with an explicit call to `.bug` /// or `.span_bug` rather than a failed assertion, etc. -#[deriving(Copy)] +#[derive(Copy)] pub struct ExplicitBug; /// A span-handler is like a handler but also @@ -222,7 +222,7 @@ pub fn mk_handler(e: Box) -> Handler { } } -#[deriving(Copy, PartialEq, Clone)] +#[derive(Copy, PartialEq, Clone)] pub enum Level { Bug, Fatal, diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index efb4867a016be..9b3ffc85a0193 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -233,7 +233,7 @@ impl MacResult for MacItems { /// Fill-in macro expansion result, to allow compilation to continue /// after hitting errors. -#[deriving(Copy)] +#[derive(Copy)] pub struct DummyResult { expr_only: bool, span: Span @@ -311,7 +311,7 @@ pub enum SyntaxExtension { /// A syntax extension that is attached to an item and creates new items /// based upon it. /// - /// `#[deriving(...)]` is an `ItemDecorator`. + /// `#[derive(...)]` is an `ItemDecorator`. Decorator(Box), /// A syntax extension that is attached to an item and modifies it diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs index 10e14e0c97564..c02416bfbea3a 100644 --- a/src/libsyntax/ext/deriving/cmp/ord.rs +++ b/src/libsyntax/ext/deriving/cmp/ord.rs @@ -83,7 +83,7 @@ pub fn expand_deriving_ord(cx: &mut ExtCtxt, trait_def.expand(cx, mitem, item, push) } -#[deriving(Copy)] +#[derive(Copy)] pub enum OrderingOp { PartialCmpOp, LtOp, LeOp, GtOp, GeOp, } diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs index 3c8d74c14ee63..882136cb86259 100644 --- a/src/libsyntax/ext/deriving/decodable.rs +++ b/src/libsyntax/ext/deriving/decodable.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! The compiler code necessary for `#[deriving(Decodable)]`. See encodable.rs for more. +//! The compiler code necessary for `#[derive(Decodable)]`. See encodable.rs for more. use ast; use ast::{MetaItem, Item, Expr, MutMutable}; diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs index 5829f34bccc5d..b2c929123d586 100644 --- a/src/libsyntax/ext/deriving/encodable.rs +++ b/src/libsyntax/ext/deriving/encodable.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! The compiler code necessary to implement the `#[deriving(Encodable)]` +//! The compiler code necessary to implement the `#[derive(Encodable)]` //! (and `Decodable`, in decodable.rs) extension. The idea here is that -//! type-defining items may be tagged with `#[deriving(Encodable, Decodable)]`. +//! type-defining items may be tagged with `#[derive(Encodable, Decodable)]`. //! //! For example, a type like: //! //! ```ignore -//! #[deriving(Encodable, Decodable)] +//! #[derive(Encodable, Decodable)] //! struct Node { id: uint } //! ``` //! @@ -49,7 +49,7 @@ //! references other non-built-in types. A type definition like: //! //! ```ignore -//! #[deriving(Encodable, Decodable)] +//! #[derive(Encodable, Decodable)] //! struct Spanned { node: T, span: Span } //! ``` //! diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index acfb020fab67e..b8d97f365612c 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -1174,7 +1174,7 @@ impl<'a> MethodDef<'a> { } } -#[deriving(PartialEq)] // dogfooding! +#[derive(PartialEq)] // dogfooding! enum StructType { Unknown, Record, Tuple } diff --git a/src/libsyntax/ext/deriving/generic/ty.rs b/src/libsyntax/ext/deriving/generic/ty.rs index 95bdd8b9ffd2f..a236fa33eb1fe 100644 --- a/src/libsyntax/ext/deriving/generic/ty.rs +++ b/src/libsyntax/ext/deriving/generic/ty.rs @@ -24,7 +24,7 @@ use parse::token::special_idents; use ptr::P; /// The types of pointers -#[deriving(Clone)] +#[derive(Clone)] pub enum PtrTy<'a> { /// &'lifetime mut Borrowed(Option<&'a str>, ast::Mutability), @@ -34,7 +34,7 @@ pub enum PtrTy<'a> { /// A path, e.g. `::std::option::Option::` (global). Has support /// for type parameters and a lifetime. -#[deriving(Clone)] +#[derive(Clone)] pub struct Path<'a> { pub path: Vec<&'a str> , pub lifetime: Option<&'a str>, @@ -85,7 +85,7 @@ impl<'a> Path<'a> { } /// A type. Supports pointers, Self, and literals -#[deriving(Clone)] +#[derive(Clone)] pub enum Ty<'a> { Self, /// &/Box/ Ty @@ -217,7 +217,7 @@ fn mk_generics(lifetimes: Vec, ty_params: Vec) } /// Lifetimes and bounds on type parameters -#[deriving(Clone)] +#[derive(Clone)] pub struct LifetimeBounds<'a> { pub lifetimes: Vec<(&'a str, Vec<&'a str>)>, pub bounds: Vec<(&'a str, Vec>)>, diff --git a/src/libsyntax/ext/deriving/hash.rs b/src/libsyntax/ext/deriving/hash.rs index 9ad0ad1621765..9ff42d85cfbb8 100644 --- a/src/libsyntax/ext/deriving/hash.rs +++ b/src/libsyntax/ext/deriving/hash.rs @@ -99,7 +99,7 @@ fn hash_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) } if stmts.len() == 0 { - cx.span_bug(trait_span, "#[deriving(Hash)] needs at least one field"); + cx.span_bug(trait_span, "#[derive(Hash)] needs at least one field"); } cx.expr_block(cx.block(trait_span, stmts, None)) diff --git a/src/libsyntax/ext/deriving/show.rs b/src/libsyntax/ext/deriving/show.rs index 2788c89676a3a..0513c75cf57da 100644 --- a/src/libsyntax/ext/deriving/show.rs +++ b/src/libsyntax/ext/deriving/show.rs @@ -67,7 +67,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span, Struct(_) => substr.type_ident, EnumMatching(_, v, _) => v.node.name, EnumNonMatchingCollapsed(..) | StaticStruct(..) | StaticEnum(..) => { - cx.span_bug(span, "nonsensical .fields in `#[deriving(Show)]`") + cx.span_bug(span, "nonsensical .fields in `#[derive(Show)]`") } }; diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 5de7068563d59..884baa2fae093 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -802,7 +802,7 @@ fn expand_arm(arm: ast::Arm, fld: &mut MacroExpander) -> ast::Arm { /// A visitor that extracts the PatIdent (binding) paths /// from a given thingy and puts them in a mutable /// array -#[deriving(Clone)] +#[derive(Clone)] struct PatIdentFinder { ident_accumulator: Vec } @@ -1320,7 +1320,7 @@ mod test { // a visitor that extracts the paths // from a given thingy and puts them in a mutable // array (passed in to the traversal) - #[deriving(Clone)] + #[derive(Clone)] struct PathExprFinderContext { path_accumulator: Vec , } diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index 500070a14d2d9..1f39555f4962c 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -24,7 +24,7 @@ use ptr::P; use std::collections::HashMap; use std::iter::repeat; -#[deriving(PartialEq)] +#[derive(PartialEq)] enum ArgumentType { Known(String), Unsigned diff --git a/src/libsyntax/ext/mtwt.rs b/src/libsyntax/ext/mtwt.rs index 6a296333fdb6a..bac82494f28aa 100644 --- a/src/libsyntax/ext/mtwt.rs +++ b/src/libsyntax/ext/mtwt.rs @@ -39,7 +39,7 @@ pub struct SCTable { rename_memo: RefCell>, } -#[deriving(PartialEq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] +#[derive(PartialEq, RustcEncodable, RustcDecodable, Hash, Show, Copy)] pub enum SyntaxContext_ { EmptyCtxt, Mark (Mrk,SyntaxContext), @@ -312,7 +312,7 @@ mod tests { // because of the SCTable, I now need a tidy way of // creating syntax objects. Sigh. - #[deriving(Clone, PartialEq, Show)] + #[derive(Clone, PartialEq, Show)] enum TestSC { M(Mrk), R(Ident,Name) diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 65ecf701e8dfc..69e473055e8e4 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -103,7 +103,7 @@ use std::collections::hash_map::Entry::{Vacant, Occupied}; // To avoid costly uniqueness checks, we require that `MatchSeq` always has // a nonempty body. -#[deriving(Clone)] +#[derive(Clone)] enum TokenTreeOrTokenTreeVec { Tt(ast::TokenTree), TtSeq(Rc>), @@ -126,13 +126,13 @@ impl TokenTreeOrTokenTreeVec { } /// an unzipping of `TokenTree`s -#[deriving(Clone)] +#[derive(Clone)] struct MatcherTtFrame { elts: TokenTreeOrTokenTreeVec, idx: uint, } -#[deriving(Clone)] +#[derive(Clone)] pub struct MatcherPos { stack: Vec, top_elts: TokenTreeOrTokenTreeVec, diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index deed0b78e87e4..73956b52caffd 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -24,7 +24,7 @@ use std::ops::Add; use std::collections::HashMap; ///an unzipping of `TokenTree`s -#[deriving(Clone)] +#[derive(Clone)] struct TtFrame { forest: TokenTree, idx: uint, @@ -32,7 +32,7 @@ struct TtFrame { sep: Option, } -#[deriving(Clone)] +#[derive(Clone)] pub struct TtReader<'a> { pub sp_diag: &'a SpanHandler, /// the unzipped tree: @@ -99,7 +99,7 @@ fn lookup_cur_matched(r: &TtReader, name: Ident) -> Option> { matched_opt.map(|s| lookup_cur_matched_by_matched(r, s)) } -#[deriving(Clone)] +#[derive(Clone)] enum LockstepIterSize { LisUnconstrained, LisConstraint(uint, Ident), diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index b2c2d7eb626d1..ada01231eb441 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -99,7 +99,7 @@ enum Status { } /// A set of features to be used by later passes. -#[deriving(Copy)] +#[derive(Copy)] pub struct Features { pub default_type_params: bool, pub unboxed_closures: bool, diff --git a/src/libsyntax/owned_slice.rs b/src/libsyntax/owned_slice.rs index 3023c547fb053..1947a14fce9db 100644 --- a/src/libsyntax/owned_slice.rs +++ b/src/libsyntax/owned_slice.rs @@ -15,7 +15,7 @@ use serialize::{Encodable, Decodable, Encoder, Decoder}; /// A non-growable owned slice. This is a separate type to allow the /// representation to change. -#[deriving(Hash, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct OwnedSlice { data: Box<[T]> } diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index b8da8365f7e23..0d5592b57b1d1 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -24,7 +24,7 @@ use std::str; use std::string::String; use std::uint; -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum CommentStyle { /// No code on either side of each line of the comment Isolated, @@ -36,7 +36,7 @@ pub enum CommentStyle { BlankLine, } -#[deriving(Clone)] +#[derive(Clone)] pub struct Comment { pub style: CommentStyle, pub lines: Vec, @@ -327,7 +327,7 @@ fn consume_comment(rdr: &mut StringReader, debug!("<<< consume comment"); } -#[deriving(Clone)] +#[derive(Clone)] pub struct Literal { pub lit: String, pub pos: BytePos, diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 13d020f6ae31b..d01c6a94f2280 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -50,7 +50,7 @@ pub trait Reader { } } -#[deriving(Clone, PartialEq, Eq, Show)] +#[derive(Clone, PartialEq, Eq, Show)] pub struct TokenAndSpan { pub tok: token::Token, pub sp: Span, diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index e3c831c09bac5..e1e456f880ed7 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -22,7 +22,7 @@ use parse::token; use ptr::P; /// The specific types of unsupported syntax -#[deriving(Copy, PartialEq, Eq, Hash)] +#[derive(Copy, PartialEq, Eq, Hash)] pub enum ObsoleteSyntax { ObsoleteOwnedType, ObsoleteOwnedExpr, diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f84ddcf360ebe..e67dd3b4f052c 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -105,7 +105,7 @@ type ItemInfo = (Ident, Item_, Option >); /// How to parse a path. There are four different kinds of paths, all of which /// are parsed somewhat differently. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum PathParsingMode { /// A path with no type parameters; e.g. `foo::bar::Baz` NoTypesAllowed, @@ -118,7 +118,7 @@ pub enum PathParsingMode { } /// How to parse a bound, whether to allow bound modifiers such as `?`. -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum BoundParsingMode { Bare, Modified, @@ -317,7 +317,7 @@ pub struct Parser<'a> { pub expected_tokens: Vec, } -#[deriving(PartialEq, Eq, Clone)] +#[derive(PartialEq, Eq, Clone)] pub enum TokenType { Token(token::Token), Operator, diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index f22a4b5c6ed10..65347d53e022c 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -28,7 +28,7 @@ use std::path::BytesContainer; use std::rc::Rc; #[allow(non_camel_case_types)] -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum BinOpToken { Plus, Minus, @@ -43,7 +43,7 @@ pub enum BinOpToken { } /// A delimeter token -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum DelimToken { /// A round parenthesis: `(` or `)` Paren, @@ -53,14 +53,14 @@ pub enum DelimToken { Brace, } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum IdentStyle { /// `::` follows the identifier with no whitespace in-between. ModName, Plain, } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum Lit { Byte(ast::Name), Char(ast::Name), @@ -86,7 +86,7 @@ impl Lit { } #[allow(non_camel_case_types)] -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show)] pub enum Token { /* Expression-operator symbols. */ Eq, @@ -334,7 +334,7 @@ impl Token { } } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash)] /// For interpolation during macro expansion. pub enum Nonterminal { NtItem(P), @@ -430,7 +430,7 @@ macro_rules! declare_special_idents_and_keywords {( pub use self::Keyword::*; use ast; - #[deriving(Copy)] + #[derive(Copy)] pub enum Keyword { $( $sk_variant, )* $( $rk_variant, )* @@ -580,7 +580,7 @@ pub fn reset_ident_interner() { /// destroyed. In particular, they must not access string contents. This can /// be fixed in the future by just leaking all strings until task death /// somehow. -#[deriving(Clone, PartialEq, Hash, PartialOrd, Eq, Ord)] +#[derive(Clone, PartialEq, Hash, PartialOrd, Eq, Ord)] pub struct InternedString { string: RcStr, } diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index a15f1ca354bff..11cefc8719bab 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -67,25 +67,25 @@ use std::io; use std::string; use std::iter::repeat; -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum Breaks { Consistent, Inconsistent, } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct BreakToken { offset: int, blank_space: int } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] pub struct BeginToken { offset: int, breaks: Breaks } -#[deriving(Clone)] +#[derive(Clone)] pub enum Token { String(string::String, int), Break(BreakToken), @@ -148,13 +148,13 @@ pub fn buf_str(toks: Vec, s } -#[deriving(Copy)] +#[derive(Copy)] pub enum PrintStackBreak { Fits, Broken(Breaks), } -#[deriving(Copy)] +#[derive(Copy)] pub struct PrintStackElem { offset: int, pbreak: PrintStackBreak diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 877b2c7b7d366..8a3349a9593d2 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -46,12 +46,12 @@ pub trait PpAnn { fn post(&self, _state: &mut State, _node: AnnNode) -> IoResult<()> { Ok(()) } } -#[deriving(Copy)] +#[derive(Copy)] pub struct NoAnn; impl PpAnn for NoAnn {} -#[deriving(Copy)] +#[derive(Copy)] pub struct CurrentCommentAndLiteral { cur_cmnt: uint, cur_lit: uint, diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 93fe868f52c68..e480532a41053 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -282,7 +282,7 @@ fn strip_test_functions(krate: ast::Crate) -> ast::Crate { }) } -#[deriving(PartialEq)] +#[derive(PartialEq)] enum HasTestSignature { Yes, No, diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 97eb43165833a..96c27c0c6edbb 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -90,7 +90,7 @@ impl Interner { } } -#[deriving(Clone, PartialEq, Hash, PartialOrd)] +#[derive(Clone, PartialEq, Hash, PartialOrd)] pub struct RcStr { string: Rc, } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 40ca6354ca6d1..c052d0d2b5142 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -32,7 +32,7 @@ use codemap::Span; use ptr::P; use owned_slice::OwnedSlice; -#[deriving(Copy)] +#[derive(Copy)] pub enum FnKind<'a> { /// fn foo() or extern "Abi" fn foo() FkItemFn(Ident, &'a Generics, Unsafety, Abi), diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index 420b1100ec1cd..3a442080077f3 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -171,7 +171,7 @@ pub mod attr { /// Most attributes can only be turned on and must be turned off with term.reset(). /// The ones that can be turned off explicitly take a boolean value. /// Color is also represented as an attribute for convenience. - #[deriving(Copy)] + #[derive(Copy)] pub enum Attr { /// Bold (or possibly bright) mode Bold, diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs index d944d0362fbe5..80d195d921846 100644 --- a/src/libterm/terminfo/mod.rs +++ b/src/libterm/terminfo/mod.rs @@ -24,7 +24,7 @@ use self::parm::{expand, Number, Variables}; /// A parsed terminfo database entry. -#[deriving(Show)] +#[derive(Show)] pub struct TermInfo { /// Names for the terminal pub names: Vec , diff --git a/src/libterm/terminfo/parm.rs b/src/libterm/terminfo/parm.rs index 35d1e166e9ca4..04238f1c96536 100644 --- a/src/libterm/terminfo/parm.rs +++ b/src/libterm/terminfo/parm.rs @@ -18,7 +18,7 @@ use std::ascii::OwnedAsciiExt; use std::mem::replace; use std::iter::repeat; -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] enum States { Nothing, Percent, @@ -35,7 +35,7 @@ enum States { SeekIfEndPercent(int) } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] enum FormatState { FormatStateFlags, FormatStateWidth, @@ -44,7 +44,7 @@ enum FormatState { /// Types of parameters a capability can use #[allow(missing_docs)] -#[deriving(Clone)] +#[derive(Clone)] pub enum Param { Words(String), Number(int) @@ -444,7 +444,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) Ok(output) } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] struct Flags { width: uint, precision: uint, @@ -461,7 +461,7 @@ impl Flags { } } -#[deriving(Copy)] +#[derive(Copy)] enum FormatOp { FormatDigit, FormatOctal, diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 19821ecb7ca7a..56c58637cf122 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -93,7 +93,7 @@ pub mod stats; // colons. This way if some test runner wants to arrange the tests // hierarchically it may. -#[deriving(Clone, PartialEq, Eq, Hash)] +#[derive(Clone, PartialEq, Eq, Hash)] pub enum TestName { StaticTestName(&'static str), DynTestName(String) @@ -112,7 +112,7 @@ impl Show for TestName { } } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] enum NamePadding { PadNone, PadOnLeft, @@ -187,14 +187,14 @@ impl fmt::Show for TestFn { /// This is feed into functions marked with `#[bench]` to allow for /// set-up & tear-down before running a piece of code repeatedly via a /// call to `iter`. -#[deriving(Copy)] +#[derive(Copy)] pub struct Bencher { iterations: u64, dur: Duration, pub bytes: u64, } -#[deriving(Copy, Clone, Show, PartialEq, Eq, Hash)] +#[derive(Copy, Clone, Show, PartialEq, Eq, Hash)] pub enum ShouldFail { No, Yes(Option<&'static str>) @@ -202,20 +202,20 @@ pub enum ShouldFail { // The definition of a single test. A test runner will run a list of // these. -#[deriving(Clone, Show, PartialEq, Eq, Hash)] +#[derive(Clone, Show, PartialEq, Eq, Hash)] pub struct TestDesc { pub name: TestName, pub ignore: bool, pub should_fail: ShouldFail, } -#[deriving(Show)] +#[derive(Show)] pub struct TestDescAndFn { pub desc: TestDesc, pub testfn: TestFn, } -#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Show, Copy)] +#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Show, Copy)] pub struct Metric { value: f64, noise: f64 @@ -227,7 +227,7 @@ impl Metric { } } -#[deriving(PartialEq)] +#[derive(PartialEq)] pub struct MetricMap(BTreeMap); impl Clone for MetricMap { @@ -238,7 +238,7 @@ impl Clone for MetricMap { } /// Analysis of a single change in metric -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] pub enum MetricChange { LikelyNoise, MetricAdded, @@ -283,7 +283,7 @@ pub fn test_main_static(args: &[String], tests: &[TestDescAndFn]) { test_main(args, owned_tests) } -#[deriving(Copy)] +#[derive(Copy)] pub enum ColorConfig { AutoColor, AlwaysColor, @@ -508,13 +508,13 @@ pub fn opt_shard(maybestr: Option) -> Option<(uint,uint)> { } -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub struct BenchSamples { ns_iter_summ: stats::Summary, mb_s: uint, } -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] pub enum TestResult { TrOk, TrFailed, @@ -967,7 +967,7 @@ fn use_color(opts: &TestOpts) -> bool { } } -#[deriving(Clone)] +#[derive(Clone)] enum TestEvent { TeFiltered(Vec ), TeWait(TestDesc, NamePadding), diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index 41146cded704c..520bc7e8cf75b 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -126,7 +126,7 @@ pub trait Stats for Sized? { } /// Extracted collection of all the summary statistics of a sample set. -#[deriving(Clone, PartialEq)] +#[derive(Clone, PartialEq)] #[allow(missing_docs)] pub struct Summary { pub sum: T, diff --git a/src/libtime/lib.rs b/src/libtime/lib.rs index 87a00334c478f..8a47a560e9039 100644 --- a/src/libtime/lib.rs +++ b/src/libtime/lib.rs @@ -76,7 +76,7 @@ mod imp { } /// A record specifying a time value in seconds and nanoseconds. -#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, RustcEncodable, +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Show, Copy)] pub struct Timespec { pub sec: i64, @@ -233,7 +233,7 @@ pub fn tzset() { /// also called a broken-down time value. // FIXME: use c_int instead of i32? #[repr(C)] -#[deriving(Clone, Copy, PartialEq, Eq, Show)] +#[derive(Clone, Copy, PartialEq, Eq, Show)] pub struct Tm { /// Seconds after the minute - [0, 60] pub tm_sec: i32, @@ -415,7 +415,7 @@ impl Tm { } } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] pub enum ParseError { InvalidSecond, InvalidMinute, diff --git a/src/libunicode/lib.rs b/src/libunicode/lib.rs index d33362ec23295..d7976b1617bda 100644 --- a/src/libunicode/lib.rs +++ b/src/libunicode/lib.rs @@ -78,7 +78,7 @@ pub mod str { pub use u_str::{utf16_items, Utf16Encoder}; } -// this lets us use #[deriving(..)] +// this lets us use #[derive(..)] mod std { pub use core::clone; pub use core::cmp; diff --git a/src/libunicode/tables.rs b/src/libunicode/tables.rs index 5a8f63f207e27..e3550810010b5 100644 --- a/src/libunicode/tables.rs +++ b/src/libunicode/tables.rs @@ -7807,7 +7807,7 @@ pub mod grapheme { use core::result::Result::{Ok, Err}; #[allow(non_camel_case_types)] - #[deriving(Clone)] + #[derive(Clone)] pub enum GraphemeCat { GC_LV, GC_LVT, diff --git a/src/libunicode/u_str.rs b/src/libunicode/u_str.rs index 9b473ea5f54a7..9d9fda4f70b43 100644 --- a/src/libunicode/u_str.rs +++ b/src/libunicode/u_str.rs @@ -99,7 +99,7 @@ impl UnicodeStr for str { } /// External iterator for grapheme clusters and byte offsets. -#[deriving(Clone)] +#[derive(Clone)] pub struct GraphemeIndices<'a> { start_offset: uint, iter: Graphemes<'a>, @@ -126,7 +126,7 @@ impl<'a> DoubleEndedIterator<(uint, &'a str)> for GraphemeIndices<'a> { /// External iterator for a string's /// [grapheme clusters](http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries). -#[deriving(Clone)] +#[derive(Clone)] pub struct Graphemes<'a> { string: &'a str, extended: bool, @@ -135,7 +135,7 @@ pub struct Graphemes<'a> { } // state machine for cluster boundary rules -#[deriving(PartialEq,Eq)] +#[derive(PartialEq,Eq)] enum GraphemeState { Start, FindExtend, @@ -401,12 +401,12 @@ pub fn is_utf16(v: &[u16]) -> bool { /// An iterator that decodes UTF-16 encoded codepoints from a vector /// of `u16`s. -#[deriving(Clone)] +#[derive(Clone)] pub struct Utf16Items<'a> { iter: slice::Iter<'a, u16> } /// The possibilities for values decoded from a `u16` stream. -#[deriving(PartialEq, Eq, Clone, Show)] +#[derive(PartialEq, Eq, Clone, Show)] pub enum Utf16Item { /// A valid codepoint. ScalarValue(char), @@ -497,7 +497,7 @@ pub fn utf16_items<'a>(v: &'a [u16]) -> Utf16Items<'a> { } /// Iterator adaptor for encoding `char`s to UTF-16. -#[deriving(Clone)] +#[derive(Clone)] pub struct Utf16Encoder { chars: I, extra: u16 diff --git a/src/test/run-pass/associated-types-binding-in-where-clause.rs b/src/test/run-pass/associated-types-binding-in-where-clause.rs index c3300c5293575..e3bd587742c31 100644 --- a/src/test/run-pass/associated-types-binding-in-where-clause.rs +++ b/src/test/run-pass/associated-types-binding-in-where-clause.rs @@ -17,7 +17,7 @@ pub trait Foo { fn boo(&self) -> ::A; } -#[deriving(PartialEq)] +#[derive(PartialEq)] struct Bar; impl Foo for int { diff --git a/src/test/run-pass/associated-types-return.rs b/src/test/run-pass/associated-types-return.rs index d8e277510ed10..1c2ff46689546 100644 --- a/src/test/run-pass/associated-types-return.rs +++ b/src/test/run-pass/associated-types-return.rs @@ -17,7 +17,7 @@ pub trait Foo { fn boo(&self) -> ::A; } -#[deriving(PartialEq)] +#[derive(PartialEq)] struct Bar; impl Foo for int {