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/grammar/verify.rs b/src/grammar/verify.rs index bdb616fcc99b8..56e1736196ece 100644 --- a/src/grammar/verify.rs +++ b/src/grammar/verify.rs @@ -26,7 +26,7 @@ use std::io::File; use syntax::parse; use syntax::parse::lexer; -use rustc::session::{mod, config}; +use rustc::session::{self, config}; use syntax::ast; use syntax::ast::Name; diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 59106aa97772a..0a81418334674 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -71,7 +71,7 @@ use core::atomic; use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst}; use core::borrow::BorrowFrom; use core::clone::Clone; -use core::fmt::{mod, Show}; +use core::fmt::{self, Show}; use core::cmp::{Eq, Ord, PartialEq, PartialOrd, Ordering}; use core::default::Default; use core::kinds::{Sync, Send}; @@ -81,7 +81,7 @@ use core::nonzero::NonZero; use core::ops::{Drop, Deref}; use core::option::Option; use core::option::Option::{Some, None}; -use core::ptr::{mod, PtrExt}; +use core::ptr::{self, PtrExt}; use heap::deallocate; /// An atomically reference counted wrapper for shared state. @@ -800,6 +800,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/liballoc/boxed.rs b/src/liballoc/boxed.rs index e836b08459bb8..362f6c66b599d 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -17,7 +17,7 @@ use core::clone::Clone; use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering}; use core::default::Default; use core::fmt; -use core::hash::{mod, Hash}; +use core::hash::{self, Hash}; use core::kinds::Sized; use core::mem; use core::option::Option; diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index c57231fc434cd..c4b455aff5c53 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -147,14 +147,14 @@ use core::clone::Clone; use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering}; use core::default::Default; use core::fmt; -use core::hash::{mod, Hash}; +use core::hash::{self, Hash}; use core::kinds::marker; use core::mem::{transmute, min_align_of, size_of, forget}; use core::nonzero::NonZero; use core::ops::{Deref, Drop}; use core::option::Option; use core::option::Option::{Some, None}; -use core::ptr::{mod, PtrExt}; +use core::ptr::{self, PtrExt}; use core::result::Result; use core::result::Result::{Ok, Err}; @@ -264,7 +264,7 @@ pub fn is_unique(rc: &Rc) -> bool { /// # Example /// /// ``` -/// use std::rc::{mod, Rc}; +/// use std::rc::{self, Rc}; /// /// let x = Rc::new(3u); /// assert_eq!(rc::try_unwrap(x), Ok(3u)); @@ -298,7 +298,7 @@ pub fn try_unwrap(rc: Rc) -> Result> { /// # Example /// /// ``` -/// use std::rc::{mod, Rc}; +/// use std::rc::{self, Rc}; /// /// let mut x = Rc::new(3u); /// *rc::get_mut(&mut x).unwrap() = 4u; 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 da461ae2d4d53..4a550e5ce277d 100644 --- a/src/libcollections/binary_heap.rs +++ b/src/libcollections/binary_heap.rs @@ -30,7 +30,7 @@ //! use std::collections::BinaryHeap; //! use std::uint; //! -//! #[deriving(Copy, Eq, PartialEq)] +//! #[derive(Copy, Eq, PartialEq)] //! struct State { //! cost: uint, //! position: uint, @@ -157,12 +157,12 @@ use core::mem::{zeroed, replace, swap}; use core::ptr; use slice; -use vec::{mod, Vec}; +use vec::{self, 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, @@ -565,7 +565,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 9674885c857c4..9f005a327b17c 100644 --- a/src/libcollections/bit.rs +++ b/src/libcollections/bit.rs @@ -89,7 +89,7 @@ use core::fmt; use core::hash; use core::iter::RandomAccessIterator; use core::iter::{Chain, Enumerate, Repeat, Skip, Take, repeat, Cloned}; -use core::iter::{mod, FromIterator}; +use core::iter::{self, FromIterator}; use core::num::Int; use core::ops::Index; use core::slice; @@ -1040,7 +1040,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, @@ -1139,7 +1139,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, @@ -1784,7 +1784,7 @@ impl hash::Hash for BitvSet { } /// An iterator for `BitvSet`. -#[deriving(Clone)] +#[derive(Clone)] #[stable] pub struct SetIter<'a> { set: &'a BitvSet, @@ -1792,7 +1792,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 e86e93266652a..159f572319394 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -33,9 +33,9 @@ use ring_buf::RingBuf; use self::Continuation::{Continue, Finished}; use self::StackOp::*; use super::node::ForceResult::{Leaf, Internal}; -use super::node::TraversalItem::{mod, Elem, Edge}; +use super::node::TraversalItem::{self, Elem, Edge}; use super::node::{Traversal, MutTraversal, MoveTraversal}; -use super::node::{mod, Node, Found, GoDown}; +use super::node::{self, Node, Found, GoDown}; // FIXME(conventions): implement bounded iterators @@ -81,7 +81,7 @@ use super::node::{mod, Node, Found, GoDown}; /// 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, @@ -505,7 +505,7 @@ mod stack { use core::mem; use core::ops::{Deref, DerefMut}; use super::BTreeMap; - use super::super::node::{mod, Node, Fit, Split, Internal, Leaf}; + use super::super::node::{self, Node, Fit, Split, Internal, Leaf}; use super::super::node::handle; use vec::Vec; diff --git a/src/libcollections/btree/node.rs b/src/libcollections/btree/node.rs index f50650c2c8be3..1f719da590b34 100644 --- a/src/libcollections/btree/node.rs +++ b/src/libcollections/btree/node.rs @@ -496,7 +496,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 a2899f76dad4c..0406edcdd32e7 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -14,7 +14,7 @@ use core::prelude::*; use core::borrow::BorrowFrom; -use core::cmp::Ordering::{mod, Less, Greater, Equal}; +use core::cmp::Ordering::{self, Less, Greater, Equal}; use core::default::Default; use core::fmt::Show; use core::fmt; @@ -30,7 +30,7 @@ use btree_map::{BTreeMap, Keys}; /// /// 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 b3d61f445639b..6d7e6778ec989 100644 --- a/src/libcollections/dlist.rs +++ b/src/libcollections/dlist.rs @@ -26,7 +26,7 @@ use core::cmp::Ordering; use core::default::Default; use core::fmt; use core::hash::{Writer, Hash}; -use core::iter::{mod, FromIterator}; +use core::iter::{self, FromIterator}; use core::mem; use core::ptr; @@ -84,7 +84,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 81e1541bea0bf..324e0cb2b7ba9 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -21,7 +21,7 @@ use core::ops::{Sub, BitOr, BitAnd, BitXor}; // 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 @@ -223,7 +223,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 { @@ -287,7 +287,7 @@ mod test { use super::{EnumSet, CLike}; - #[deriving(Copy, PartialEq, Show)] + #[derive(Copy, PartialEq, Show)] #[repr(uint)] enum Foo { A, B, C @@ -491,7 +491,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 dd78ae03c5af7..77f41a2b0a7e5 100644 --- a/src/libcollections/ring_buf.rs +++ b/src/libcollections/ring_buf.rs @@ -17,7 +17,7 @@ use core::prelude::*; use core::cmp::Ordering; use core::default::Default; use core::fmt; -use core::iter::{mod, FromIterator, RandomAccessIterator}; +use core::iter::{self, FromIterator, RandomAccessIterator}; use core::kinds::marker; use core::mem; use core::num::{Int, UnsignedInt}; @@ -1139,7 +1139,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 { @@ -1674,21 +1674,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 5db4e8580d0a4..510be24befd1c 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -90,15 +90,15 @@ use alloc::boxed::Box; use core::borrow::{BorrowFrom, BorrowFromMut, ToOwned}; use core::clone::Clone; -use core::cmp::Ordering::{mod, Greater, Less}; -use core::cmp::{mod, Ord, PartialEq}; +use core::cmp::Ordering::{self, Greater, Less}; +use core::cmp::{self, Ord, PartialEq}; use core::iter::{Iterator, IteratorExt, IteratorCloneExt}; use core::iter::{range, range_step, MultiplicativeIterator}; use core::kinds::Sized; use core::mem::size_of; use core::mem; use core::ops::{FnMut, SliceMut}; -use core::option::Option::{mod, Some, None}; +use core::option::Option::{self, Some, None}; use core::ptr::PtrExt; use core::ptr; use core::result::Result; @@ -1083,7 +1083,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 @@ -1130,11 +1130,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, @@ -2709,7 +2709,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 6c51480931b3b..fe85d4a5a9307 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -64,10 +64,10 @@ use core::default::Default; use core::fmt; use core::hash; use core::iter::AdditiveIterator; -use core::iter::{mod, range, Iterator, IteratorExt}; +use core::iter::{self, range, Iterator, IteratorExt}; use core::kinds::Sized; use core::ops; -use core::option::Option::{mod, Some, None}; +use core::option::Option::{self, Some, None}; use core::slice::AsSlice; use core::str as core_str; use unicode::str::{UnicodeStr, Utf16Encoder}; @@ -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>, @@ -252,7 +252,7 @@ impl<'a> Iterator for Decompositions<'a> { } } -#[deriving(Clone)] +#[derive(Clone)] enum RecompositionState { Composing, Purging, @@ -261,7 +261,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, @@ -356,7 +356,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 35fa3fb55de23..0cd3770d39136 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -23,17 +23,17 @@ use core::fmt; use core::hash; use core::iter::FromIterator; use core::mem; -use core::ops::{mod, Deref, Add}; +use core::ops::{self, Deref, Add}; use core::ptr; use core::raw::Slice as RawSlice; use unicode::str as unicode_str; use unicode::str::Utf16Item; -use str::{mod, CharRange, FromStr, Utf8Error}; +use str::{self, 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 073388018725a..04bdd04bfaacf 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -53,7 +53,7 @@ use core::cmp::max; use core::cmp::{Equiv, Ordering}; use core::default::Default; use core::fmt; -use core::hash::{mod, Hash}; +use core::hash::{self, Hash}; use core::iter::{repeat, FromIterator}; use core::kinds::marker::{ContravariantLifetime, InvariantType}; use core::mem; @@ -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)); @@ -2276,7 +2276,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]); } @@ -2286,11 +2286,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 91edbc7b54e41..b9c1a6a43f972 100644 --- a/src/libcollections/vec_map.rs +++ b/src/libcollections/vec_map.rs @@ -673,7 +673,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 { @@ -705,7 +705,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 { @@ -720,7 +720,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 f653998c9bf5d..5d3bcb19ae867 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 aa6028a19b323..3bd200d38d715 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, @@ -490,12 +490,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 38906892a339f..6b52d1817e9c4 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -44,7 +44,7 @@ use self::Ordering::*; use kinds::Sized; -use option::Option::{mod, Some, None}; +use option::Option::{self, Some, None}; /// Trait for equality comparisons which are [partial equivalence relations]( /// http://en.wikipedia.org/wiki/Partial_equivalence_relation). @@ -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/float.rs b/src/libcore/fmt/float.rs index 27023fab858d9..9e62226220c0e 100644 --- a/src/libcore/fmt/float.rs +++ b/src/libcore/fmt/float.rs @@ -22,8 +22,8 @@ use num::{cast, Float, ToPrimitive}; use num::FpCategory as Fp; use ops::FnOnce; use result::Result::Ok; -use slice::{mod, SliceExt}; -use str::{mod, StrExt}; +use slice::{self, SliceExt}; +use str::{self, StrExt}; /// A flag that specifies whether to use exponential (scientific) notation. pub enum ExponentFormat { diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 13fbf5232f8dc..f49f87ff329f0 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -24,7 +24,7 @@ use result::Result::{Ok, Err}; use result; use slice::SliceExt; use slice; -use str::{mod, StrExt, Utf8Error}; +use str::{self, StrExt, Utf8Error}; pub use self::num::radix; pub use self::num::Radix; @@ -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. @@ -122,7 +122,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, @@ -199,7 +199,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 e680230265aa6..e0724fc2da5f5 100644 --- a/src/libcore/fmt/num.rs +++ b/src/libcore/fmt/num.rs @@ -67,23 +67,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 { @@ -110,7 +110,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, @@ -136,7 +136,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 020f0f6de9bab..f9da0493f3edb 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 c5af7e27c6a84..7e1359d5c1201 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, @@ -545,7 +545,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 f65857b37fb2d..b409b79cbf505 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -885,7 +885,7 @@ impl ExactSizeIterator for Map where impl ExactSizeIterator for Zip where A: ExactSizeIterator, B: 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 { @@ -1153,7 +1153,7 @@ impl IteratorOrdExt for I where I: Iterator, T: Ord { } /// `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 @@ -1176,7 +1176,7 @@ impl MinMaxResult { /// # Example /// /// ```rust - /// use std::iter::MinMaxResult::{mod, NoElements, OneElement, MinMax}; + /// use std::iter::MinMaxResult::{self, NoElements, OneElement, MinMax}; /// /// let r: MinMaxResult = NoElements; /// assert_eq!(r.into_option(), None); @@ -1280,7 +1280,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 { @@ -1338,7 +1338,7 @@ impl RandomAccessIterator for Cycle where } /// 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 { @@ -1418,7 +1418,7 @@ impl RandomAccessIterator for Chain where } /// 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 { @@ -1517,7 +1517,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, @@ -1594,7 +1594,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, @@ -1655,7 +1655,7 @@ pub struct FilterMap where I: Iterator, F: FnMut(A) -> Optio 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, @@ -1712,7 +1712,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 { @@ -1775,7 +1775,7 @@ impl RandomAccessIterator for Enumerate where I: RandomAccessIterator { /// 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 where I: Iterator { iter: I, peeked: Option, @@ -1837,7 +1837,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, @@ -1883,7 +1883,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, @@ -1929,7 +1929,7 @@ impl Iterator for TakeWhile where I: Iterator, P: FnMu } /// 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 { @@ -1999,7 +1999,7 @@ impl RandomAccessIterator for Skip where I: RandomAccessIterator{ } /// 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 { @@ -2065,7 +2065,7 @@ pub struct Scan where I: Iterator, F: FnMut(&mut St, A) -> Optio 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, @@ -2116,7 +2116,7 @@ pub struct FlatMap where 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, @@ -2193,7 +2193,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 { @@ -2281,7 +2281,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, @@ -2391,7 +2391,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, @@ -2436,7 +2436,7 @@ impl Iterator for Unfold where F: FnMut(&mut St) -> Option { /// The current state the counter is at (next value to be yielded) @@ -2470,7 +2470,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, @@ -2565,7 +2565,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, @@ -2635,7 +2635,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, @@ -2672,7 +2672,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, @@ -2775,7 +2775,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 ba9103520d875..087404da62434 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 254788f9a75f1..4793efbe02ac3 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 bef91dbd76047..2a7df5db5c900 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -29,7 +29,7 @@ //! //! use std::ops::{Add, Sub}; //! -//! #[deriving(Show)] +//! #[derive(Show)] //! struct Point { //! x: int, //! y: int @@ -62,7 +62,7 @@ use clone::Clone; use iter::{Step, Iterator,DoubleEndedIterator,ExactSizeIterator}; use kinds::Sized; -use option::Option::{mod, Some, None}; +use option::Option::{self, Some, None}; /// The `Drop` trait is used to run some code when a value goes out of scope. This /// is sometimes called a 'destructor'. @@ -103,7 +103,7 @@ pub trait Drop { /// /// use std::ops::Add; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Add for Foo { @@ -152,7 +152,7 @@ add_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// /// use std::ops::Sub; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Sub for Foo { @@ -201,7 +201,7 @@ sub_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// /// use std::ops::Mul; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Mul for Foo { @@ -250,7 +250,7 @@ mul_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// /// use std::ops::Div; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Div for Foo { @@ -299,7 +299,7 @@ div_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// /// use std::ops::Rem; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Rem for Foo { @@ -482,7 +482,7 @@ not_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// /// use std::ops::BitAnd; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl BitAnd for Foo { @@ -531,7 +531,7 @@ bitand_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// /// use std::ops::BitOr; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl BitOr for Foo { @@ -580,7 +580,7 @@ bitor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// /// use std::ops::BitXor; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl BitXor for Foo { @@ -629,7 +629,7 @@ bitxor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// /// use std::ops::Shl; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Shl for Foo { @@ -680,7 +680,7 @@ shl_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// /// use std::ops::Shr; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Shr for Foo { @@ -739,7 +739,7 @@ pub trait Index for Sized? { /// /// use std::ops::Index; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Index for Foo { @@ -786,7 +786,7 @@ pub trait IndexMut for Sized? { /// /// use std::ops::IndexMut; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl IndexMut for Foo { @@ -822,7 +822,7 @@ pub trait IndexMut for Sized? { /// ```ignore /// use std::ops::Slice; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl Slice for Foo { @@ -871,7 +871,7 @@ pub trait Slice for Sized? { /// ```ignore /// use std::ops::SliceMut; /// -/// #[deriving(Copy)] +/// #[derive(Copy)] /// struct Foo; /// /// impl SliceMut for Foo { @@ -911,12 +911,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). @@ -966,7 +966,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). @@ -986,7 +986,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 92209b937d927..a9a1857ec97bf 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/prelude.rs b/src/libcore/prelude.rs index 1355825e56dfd..64f13a8f123a8 100644 --- a/src/libcore/prelude.rs +++ b/src/libcore/prelude.rs @@ -45,8 +45,8 @@ pub use iter::{Extend, IteratorExt}; pub use iter::{Iterator, DoubleEndedIterator}; pub use iter::{IteratorCloneExt, CloneIteratorExt}; pub use iter::{IteratorOrdExt, ExactSizeIterator}; -pub use option::Option::{mod, Some, None}; +pub use option::Option::{self, Some, None}; pub use ptr::{PtrExt, MutPtrExt}; -pub use result::Result::{mod, Ok, Err}; +pub use result::Result::{self, Ok, Err}; pub use slice::{AsSlice, SliceExt}; pub use str::{Str, StrExt}; diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index f29d75181492b..9aed78d0737cd 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -91,11 +91,11 @@ use mem; use clone::Clone; use intrinsics; -use option::Option::{mod, Some, None}; +use option::Option::{self, Some, None}; use kinds::{Send, Sized, Sync}; use cmp::{PartialEq, Eq, Ord, PartialOrd, Equiv}; -use cmp::Ordering::{mod, Less, Equal, Greater}; +use cmp::Ordering::{self, Less, Equal, Greater}; // FIXME #19649: instrinsic docs don't render, so these have no docs :( 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 b0ee5672e060d..7135faaa76516 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 { @@ -236,14 +236,14 @@ use clone::Clone; use fmt::Show; use iter::{Iterator, IteratorExt, DoubleEndedIterator, FromIterator, ExactSizeIterator}; use ops::{FnMut, FnOnce}; -use option::Option::{mod, None, Some}; +use option::Option::{self, None, Some}; use slice::AsSlice; 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 d5810a382968b..fd4bc4a141357 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -43,7 +43,7 @@ use default::Default; use iter::*; use kinds::Copy; use num::Int; -use ops::{FnMut, mod}; +use ops::{FnMut, self}; use option::Option; use option::Option::{None, Some}; use result::Result; @@ -907,7 +907,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> { @@ -1133,7 +1133,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], @@ -1170,7 +1170,7 @@ impl<'a, T> Iterator 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 7e99e4236083e..07662c567e389 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -18,7 +18,7 @@ use self::Searcher::{Naive, TwoWay, TwoWayLong}; -use cmp::{mod, Eq}; +use cmp::{self, Eq}; use default::Default; use iter::range; use iter::ExactSizeIterator; @@ -27,11 +27,11 @@ use kinds::Sized; use mem; use num::Int; use ops::{Fn, FnMut}; -use option::Option::{mod, None, Some}; +use option::Option::{self, None, Some}; use ptr::PtrExt; use raw::{Repr, Slice}; -use result::Result::{mod, Ok, Err}; -use slice::{mod, SliceExt}; +use result::Result::{self, Ok, Err}; +use slice::{self, SliceExt}; use uint; macro_rules! delegate_iter { @@ -147,7 +147,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. /// @@ -252,7 +252,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> } @@ -361,7 +361,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>, @@ -409,13 +409,13 @@ impl<'a> DoubleEndedIterator 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 { @@ -426,7 +426,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 @@ -440,7 +440,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>, @@ -564,7 +564,7 @@ impl<'a, Sep: CharEq> Iterator 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 } @@ -590,7 +590,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, @@ -827,7 +827,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), @@ -855,7 +855,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, @@ -865,7 +865,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>, @@ -1073,7 +1073,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` @@ -1249,25 +1249,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 ecb657b5a2ba5..a4d89bf301ec6 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -37,7 +37,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), @@ -47,7 +47,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>, @@ -56,7 +56,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, @@ -75,7 +75,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, @@ -86,7 +86,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, @@ -100,7 +100,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, @@ -116,7 +116,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 01e55fb2edd9a..e5a8db54eab05 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -517,7 +517,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 ac0bab67b406f..e3f02146a75f4 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, @@ -779,7 +779,7 @@ pub mod types { 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, @@ -801,13 +801,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] } } @@ -823,7 +823,7 @@ pub mod types { 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_mode: mode_t, @@ -846,13 +846,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; 8] } } @@ -862,7 +862,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, @@ -888,7 +888,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, @@ -905,18 +905,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; } @@ -929,13 +929,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], @@ -943,7 +943,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, @@ -951,11 +951,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, @@ -964,21 +964,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, @@ -989,13 +989,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, @@ -1062,7 +1062,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, @@ -1088,7 +1088,7 @@ pub mod types { } #[repr(C)] - #[deriving(Copy)] pub struct utimbuf { + #[derive(Copy)] pub struct utimbuf { pub actime: time_t, pub modtime: time_t, } @@ -1116,7 +1116,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, @@ -1133,18 +1133,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; } @@ -1157,13 +1157,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], @@ -1171,7 +1171,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, @@ -1179,11 +1179,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, @@ -1192,21 +1192,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, @@ -1217,13 +1217,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, @@ -1291,7 +1291,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, @@ -1316,7 +1316,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, } @@ -1343,7 +1343,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, @@ -1359,24 +1359,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 { @@ -1389,30 +1389,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, @@ -1420,21 +1420,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, @@ -1445,7 +1445,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] } @@ -1573,7 +1573,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, @@ -1597,7 +1597,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, @@ -1620,7 +1620,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, @@ -1629,7 +1629,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, @@ -1645,7 +1645,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, @@ -1657,7 +1657,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, @@ -1668,7 +1668,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, } @@ -1676,7 +1676,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, @@ -1684,7 +1684,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], } @@ -1692,7 +1692,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, @@ -1720,7 +1720,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, @@ -1750,7 +1750,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, @@ -1767,18 +1767,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; } @@ -1792,14 +1792,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], @@ -1808,7 +1808,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, @@ -1817,12 +1817,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, @@ -1832,24 +1832,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, @@ -1861,14 +1861,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, @@ -1931,7 +1931,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, @@ -1957,13 +1957,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] } @@ -1974,7 +1974,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, } @@ -2035,7 +2035,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, @@ -2061,13 +2061,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] } @@ -2078,7 +2078,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 4ee5b2d5e8349..0508402ff19d8 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 8e6c7de305f82..0b1dd2e13b471 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 981b0eeee53e0..580f8897885f6 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 d0123d9c76c99..e684fcf40f7b3 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 543e236f96dd2..2e1a433eb075e 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 1ea4784407592..af90a0a308dc9 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 46371d427e63f..795e8fab85692 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 69c58eebd56d0..8edbf263d7400 100644 --- a/src/libregex/re.rs +++ b/src/libregex/re.rs @@ -104,7 +104,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. @@ -117,7 +117,7 @@ pub enum Regex { Native(ExNative), } -#[deriving(Clone)] +#[derive(Clone)] #[doc(hidden)] pub struct ExDynamic { original: String, @@ -127,7 +127,7 @@ pub struct ExDynamic { } #[doc(hidden)] -#[deriving(Copy)] +#[derive(Copy)] pub struct ExNative { #[doc(hidden)] pub original: &'static str, @@ -540,7 +540,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>) @@ -599,7 +599,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, @@ -635,7 +635,7 @@ impl<'r, 't> Iterator 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, @@ -801,7 +801,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>, @@ -826,7 +826,7 @@ impl<'t> Iterator 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>, @@ -852,7 +852,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, @@ -897,7 +897,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 603ca57d15d5b..914167019d209 100644 --- a/src/libregex/vm.rs +++ b/src/libregex/vm.rs @@ -37,7 +37,7 @@ pub use self::MatchKind::*; pub use self::StepState::*; use std::cmp; -use std::cmp::Ordering::{mod, Less, Equal, Greater}; +use std::cmp::Ordering::{self, Less, Equal, Greater}; use std::mem; use std::iter::repeat; use std::slice::SliceExt; @@ -52,7 +52,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, @@ -97,7 +97,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 53249c724627e..8f03f8821285a 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -29,7 +29,7 @@ use self::MethodContext::*; use metadata::csearch; use middle::def::*; use middle::subst::Substs; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::{def, pat_util, stability}; use middle::const_eval::{eval_const_expr_partial, const_int, const_uint}; use util::ppaux::{ty_to_string}; @@ -43,13 +43,13 @@ use std::{i8, i16, i32, i64, u8, u16, u32, u64, f32, f64}; use syntax::{abi, ast, ast_map}; use syntax::ast_util::is_shift_binop; -use syntax::attr::{mod, AttrMetaMethods}; +use syntax::attr::{self, AttrMetaMethods}; use syntax::codemap::{Span, DUMMY_SP}; use syntax::parse::token; use syntax::ast::{TyI, TyU, TyI8, TyU8, TyI16, TyU16, TyI32, TyU32, TyI64, TyU64}; use syntax::ast_util; use syntax::ptr::P; -use syntax::visit::{mod, Visitor}; +use syntax::visit::{self, Visitor}; declare_lint! { WHILE_TRUE, @@ -57,7 +57,7 @@ declare_lint! { "suggest using `loop { }` instead of `while true { }`" } -#[deriving(Copy)] +#[derive(Copy)] pub struct WhileTrue; impl LintPass for WhileTrue { @@ -83,7 +83,7 @@ declare_lint! { "detects unnecessary type casts that can be removed" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedCasts; impl LintPass for UnusedCasts { @@ -125,7 +125,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, @@ -442,7 +442,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ImproperCTypesVisitor<'a, 'tcx> { } } -#[deriving(Copy)] +#[derive(Copy)] pub struct ImproperCTypes; impl LintPass for ImproperCTypes { @@ -485,7 +485,7 @@ declare_lint! { "use of owned (Box type) heap memory" } -#[deriving(Copy)] +#[derive(Copy)] pub struct BoxPointers; impl BoxPointers { @@ -625,7 +625,7 @@ declare_lint! { "detects attributes that were not used by the compiler" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedAttributes; impl LintPass for UnusedAttributes { @@ -709,7 +709,7 @@ declare_lint! { "path statements with no effect" } -#[deriving(Copy)] +#[derive(Copy)] pub struct PathStatements; impl LintPass for PathStatements { @@ -743,7 +743,7 @@ declare_lint! { "unused result of an expression in a statement" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedResults; impl LintPass for UnusedResults { @@ -811,7 +811,7 @@ declare_lint! { "types, variants, traits and type parameters should have camel case names" } -#[deriving(Copy)] +#[derive(Copy)] pub struct NonCamelCaseTypes; impl NonCamelCaseTypes { @@ -884,7 +884,7 @@ impl LintPass for NonCamelCaseTypes { } } -#[deriving(PartialEq)] +#[derive(PartialEq)] enum MethodContext { TraitDefaultImpl, TraitImpl, @@ -934,7 +934,7 @@ declare_lint! { "methods, functions, lifetime parameters and modules should have snake case names" } -#[deriving(Copy)] +#[derive(Copy)] pub struct NonSnakeCase; impl NonSnakeCase { @@ -1047,7 +1047,7 @@ declare_lint! { "static constants should have uppercase identifiers" } -#[deriving(Copy)] +#[derive(Copy)] pub struct NonUpperCaseGlobals; impl LintPass for NonUpperCaseGlobals { @@ -1100,7 +1100,7 @@ declare_lint! { "`if`, `match`, `while` and `return` do not need parentheses" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedParens; impl UnusedParens { @@ -1194,7 +1194,7 @@ declare_lint! { "unnecessary braces around an imported item" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedImportBraces; impl LintPass for UnusedImportBraces { @@ -1233,7 +1233,7 @@ declare_lint! { "using `Struct { x: x }` instead of `Struct { x }`" } -#[deriving(Copy)] +#[derive(Copy)] pub struct NonShorthandFieldPatterns; impl LintPass for NonShorthandFieldPatterns { @@ -1266,7 +1266,7 @@ declare_lint! { "unnecessary use of an `unsafe` block" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedUnsafe; impl LintPass for UnusedUnsafe { @@ -1291,7 +1291,7 @@ declare_lint! { "usage of an `unsafe` block" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnsafeBlocks; impl LintPass for UnsafeBlocks { @@ -1315,7 +1315,7 @@ declare_lint! { "detect mut variables which don't need to be mutable" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedMut; impl UnusedMut { @@ -1384,7 +1384,7 @@ declare_lint! { "detects unnecessary allocations that can be eliminated" } -#[deriving(Copy)] +#[derive(Copy)] pub struct UnusedAllocation; impl LintPass for UnusedAllocation { @@ -1575,7 +1575,7 @@ impl LintPass for MissingDoc { } } -#[deriving(Copy)] +#[derive(Copy)] pub struct MissingCopyImplementations; impl LintPass for MissingCopyImplementations { @@ -1646,7 +1646,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 { @@ -1857,7 +1857,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/context.rs b/src/librustc/lint/context.rs index ffae485364a86..69e5b4889c288 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -26,7 +26,7 @@ use self::TargetLint::*; use middle::privacy::ExportedItems; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use session::{early_error, Session}; use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass, LintPassObject}; use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid}; 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 a25b6d8b8fa46..97f5228f0330b 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -29,7 +29,7 @@ use middle::def; use middle::lang_items; use middle::subst; use middle::ty::{ImplContainer, TraitContainer}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::astencode::vtable_decoder_helpers; use std::collections::HashMap; @@ -111,7 +111,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 @@ -471,7 +471,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), @@ -1173,7 +1173,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 17663a127a881..75b9a18063e28 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -23,7 +23,7 @@ use metadata::decoder; use metadata::tyencode; use middle::def; use middle::ty::{lookup_item_type}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::stability; use util::nodemap::{FnvHashMap, NodeMap, NodeSet}; @@ -32,7 +32,7 @@ use std::cell::RefCell; use std::hash::Hash; use std::hash; use syntax::abi; -use syntax::ast::{mod, DefId, NodeId}; +use syntax::ast::{self, DefId, NodeId}; use syntax::ast_map::{PathElem, PathElems}; use syntax::ast_map; use syntax::ast_util::*; @@ -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 2d3ff95ffa66e..80b13aac89fc8 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -21,7 +21,7 @@ pub use self::DefIdSource::*; use middle::region; use middle::subst; use middle::subst::VecPerParamSpace; -use middle::ty::{mod, AsPredicate, Ty}; +use middle::ty::{self, AsPredicate, Ty}; use std::rc::Rc; use std::str; @@ -43,7 +43,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/metadata/tyencode.rs b/src/librustc/metadata/tyencode.rs index 30746f51a8fe7..5f0f51ce9033d 100644 --- a/src/librustc/metadata/tyencode.rs +++ b/src/librustc/metadata/tyencode.rs @@ -19,7 +19,7 @@ use middle::region; use middle::subst; use middle::subst::VecPerParamSpace; use middle::ty::ParamTy; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::nodemap::FnvHashMap; use syntax::abi::Abi; diff --git a/src/librustc/middle/astconv_util.rs b/src/librustc/middle/astconv_util.rs index b1b4fd831a0fa..b2ad77467276f 100644 --- a/src/librustc/middle/astconv_util.rs +++ b/src/librustc/middle/astconv_util.rs @@ -15,7 +15,7 @@ */ use middle::def; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use syntax::ast; use util::ppaux::Repr; diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 6efc80ed8d343..e4d407d66a2ee 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -26,7 +26,7 @@ use metadata::tyencode; use middle::mem_categorization::Typer; use middle::subst; use middle::subst::VecPerParamSpace; -use middle::ty::{mod, Ty, MethodCall, MethodCallee, MethodOrigin}; +use middle::ty::{self, Ty, MethodCall, MethodCallee, MethodOrigin}; use util::ppaux::ty_to_string; use syntax::{ast, ast_map, ast_util, codemap, fold}; diff --git a/src/librustc/middle/cfg/construct.rs b/src/librustc/middle/cfg/construct.rs index a7b28a6323eaf..ff5175ffdcfb2 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 74f25332ecf31..2d9284846acf3 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -27,14 +27,14 @@ use std::fmt; use std::iter::{range_inclusive, AdditiveIterator, FromIterator, repeat}; use std::num::Float; use std::slice; -use syntax::ast::{mod, DUMMY_NODE_ID, NodeId, Pat}; +use syntax::ast::{self, DUMMY_NODE_ID, NodeId, Pat}; use syntax::ast_util::walk_pat; use syntax::codemap::{Span, Spanned, DUMMY_SP}; use syntax::fold::{Folder, noop_fold_pat}; use syntax::print::pprust::pat_to_string; use syntax::parse::token; use syntax::ptr::P; -use syntax::visit::{mod, Visitor, FnKind}; +use syntax::visit::{self, Visitor, FnKind}; use util::ppaux::ty_to_string; pub const DUMMY_WILD_PAT: &'static Pat = &Pat { @@ -102,7 +102,7 @@ pub struct MatchCheckCtxt<'a, 'tcx: 'a> { pub param_env: ParameterEnvironment<'a, '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. @@ -119,14 +119,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 9c9e68002c980..df51cb7e6bc4b 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 96b2a62326b17..a62b134c48e71 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -17,14 +17,14 @@ pub use self::constness::*; use metadata::csearch; use middle::{astencode, def}; use middle::pat_util::def_to_path; -use middle::ty::{mod}; +use middle::ty::{self}; use middle::astconv_util::{ast_ty_to_prim_ty}; use util::nodemap::DefIdMap; -use syntax::ast::{mod, Expr}; +use syntax::ast::{self, Expr}; use syntax::parse::token::InternedString; use syntax::ptr::P; -use syntax::visit::{mod, Visitor}; +use syntax::visit::{self, Visitor}; use syntax::{ast_map, ast_util, codemap}; use std::collections::hash_map::Entry::Vacant; @@ -62,7 +62,7 @@ use std::rc::Rc; // - 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/dead.rs b/src/librustc/middle/dead.rs index 939775e750713..5a2085bee24c5 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -19,8 +19,8 @@ use util::nodemap::NodeSet; use std::collections::HashSet; use syntax::{ast, ast_map, codemap}; use syntax::ast_util::{local_def, is_local, PostExpansionMethod}; -use syntax::attr::{mod, AttrMetaMethods}; -use syntax::visit::{mod, Visitor}; +use syntax::attr::{self, AttrMetaMethods}; +use syntax::visit::{self, Visitor}; // Any local node that may call something in its body block should be // explored. For example, if it's a live NodeItem that is a diff --git a/src/librustc/middle/def.rs b/src/librustc/middle/def.rs index acbb7d567dcea..2e4aa787e844b 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..1075263e7512d 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -13,7 +13,7 @@ use self::UnsafeContext::*; use middle::def; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::MethodCall; use util::ppaux; @@ -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 f5cf4af1230a4..5b786ec992247 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -23,7 +23,7 @@ use self::OverloadedCallType::*; use middle::{def, region, pat_util}; use middle::mem_categorization as mc; use middle::mem_categorization::Typer; -use middle::ty::{mod}; +use middle::ty::{self}; use middle::ty::{MethodCall, MethodObject, MethodTraitObject}; use middle::ty::{MethodOrigin, MethodParam, MethodTypeParam}; use middle::ty::{MethodStatic, MethodStaticUnboxedClosure}; @@ -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..d42817bce9302 100644 --- a/src/librustc/middle/fast_reject.rs +++ b/src/librustc/middle/fast_reject.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; 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 e8efdda3888a7..52b6af7608170 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/coercion.rs b/src/librustc/middle/infer/coercion.rs index 11ca202971e1d..f6f62e035900e 100644 --- a/src/librustc/middle/infer/coercion.rs +++ b/src/librustc/middle/infer/coercion.rs @@ -67,7 +67,7 @@ use super::sub::Sub; use middle::subst; use middle::ty::{AutoPtr, AutoDerefRef, AdjustDerefRef, AutoUnsize, AutoUnsafe}; use middle::ty::{mt}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::ppaux; use util::ppaux::Repr; diff --git a/src/librustc/middle/infer/combine.rs b/src/librustc/middle/infer/combine.rs index ab6f6b601f6d0..2950705876115 100644 --- a/src/librustc/middle/infer/combine.rs +++ b/src/librustc/middle/infer/combine.rs @@ -46,7 +46,7 @@ use middle::subst::{ErasedRegions, NonerasedRegions, Substs}; use middle::ty::{FloatVar, FnSig, IntVar, TyVar}; use middle::ty::{IntType, UintType}; use middle::ty::{BuiltinBounds}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty_fold; use middle::ty_fold::{TypeFoldable}; use util::ppaux::Repr; @@ -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/equate.rs b/src/librustc/middle/infer/equate.rs index 2a4d20f4dd379..f6ac746156700 100644 --- a/src/librustc/middle/infer/equate.rs +++ b/src/librustc/middle/infer/equate.rs @@ -9,7 +9,7 @@ // except according to those terms. use middle::ty::{BuiltinBounds}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::TyVar; use middle::infer::combine::*; use middle::infer::{cres}; diff --git a/src/librustc/middle/infer/error_reporting.rs b/src/librustc/middle/infer/error_reporting.rs index 6f1c7af5b8628..7ff585087f508 100644 --- a/src/librustc/middle/infer/error_reporting.rs +++ b/src/librustc/middle/infer/error_reporting.rs @@ -74,7 +74,7 @@ use std::collections::HashSet; use middle::def; use middle::infer; use middle::subst; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::{Region, ReFree}; use std::cell::{Cell, RefCell}; use std::char::from_u32; diff --git a/src/librustc/middle/infer/freshen.rs b/src/librustc/middle/infer/freshen.rs index 33174409f899b..0ae4a3d851e7f 100644 --- a/src/librustc/middle/infer/freshen.rs +++ b/src/librustc/middle/infer/freshen.rs @@ -30,11 +30,11 @@ //! variable only once, and it does so as soon as it can, so it is reasonable to ask what the type //! inferencer knows "so far". -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty_fold; use middle::ty_fold::TypeFoldable; use middle::ty_fold::TypeFolder; -use std::collections::hash_map::{mod, Entry}; +use std::collections::hash_map::{self, Entry}; use super::InferCtxt; use super::unify::InferCtxtMethodsForSimplyUnifiableTypes; diff --git a/src/librustc/middle/infer/glb.rs b/src/librustc/middle/infer/glb.rs index 434be32fe5fa7..2683d00b858c1 100644 --- a/src/librustc/middle/infer/glb.rs +++ b/src/librustc/middle/infer/glb.rs @@ -18,7 +18,7 @@ use super::{cres, InferCtxt}; use super::{TypeTrace, Subtype}; use middle::ty::{BuiltinBounds}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use syntax::ast::{Many, Once, MutImmutable, MutMutable}; use syntax::ast::{Onceness, Unsafety}; use util::ppaux::mt_to_string; diff --git a/src/librustc/middle/infer/higher_ranked/mod.rs b/src/librustc/middle/infer/higher_ranked/mod.rs index 2a19f37e7d415..bf0a9cfbea66d 100644 --- a/src/librustc/middle/infer/higher_ranked/mod.rs +++ b/src/librustc/middle/infer/higher_ranked/mod.rs @@ -14,8 +14,8 @@ use super::{CombinedSnapshot, cres, InferCtxt, HigherRankedType, SkolemizationMap}; use super::combine::{Combine, Combineable}; -use middle::ty::{mod, Binder}; -use middle::ty_fold::{mod, TypeFoldable}; +use middle::ty::{self, Binder}; +use middle::ty_fold::{self, TypeFoldable}; use syntax::codemap::Span; use util::nodemap::{FnvHashMap, FnvHashSet}; use util::ppaux::Repr; diff --git a/src/librustc/middle/infer/lattice.rs b/src/librustc/middle/infer/lattice.rs index dd514ebee524a..121e5405f26dc 100644 --- a/src/librustc/middle/infer/lattice.rs +++ b/src/librustc/middle/infer/lattice.rs @@ -35,7 +35,7 @@ use super::glb::Glb; use super::lub::Lub; use middle::ty::{TyVar}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::ppaux::Repr; pub trait LatticeDir<'tcx> { diff --git a/src/librustc/middle/infer/lub.rs b/src/librustc/middle/infer/lub.rs index f4909b2889163..e4cab0f88990d 100644 --- a/src/librustc/middle/infer/lub.rs +++ b/src/librustc/middle/infer/lub.rs @@ -18,7 +18,7 @@ use super::{cres, InferCtxt}; use super::{TypeTrace, Subtype}; use middle::ty::{BuiltinBounds}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use syntax::ast::{Many, Once}; use syntax::ast::{Onceness, Unsafety}; use syntax::ast::{MutMutable, MutImmutable}; diff --git a/src/librustc/middle/infer/mod.rs b/src/librustc/middle/infer/mod.rs index d9b7e04bc7941..e1401898f7a79 100644 --- a/src/librustc/middle/infer/mod.rs +++ b/src/librustc/middle/infer/mod.rs @@ -25,7 +25,7 @@ use middle::subst; use middle::subst::Substs; use middle::ty::{TyVid, IntVid, FloatVid, RegionVid, UnconstrainedNumeric}; use middle::ty::replace_late_bound_regions; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty_fold::{TypeFolder, TypeFoldable}; use std::cell::{RefCell}; use std::rc::Rc; @@ -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 b6020fe5ce38b..7bc4bf1f4fe28 100644 --- a/src/librustc/middle/infer/region_inference/graphviz.rs +++ b/src/librustc/middle/infer/region_inference/graphviz.rs @@ -27,7 +27,7 @@ use util::nodemap::{FnvHashMap, FnvHashSet}; use util::ppaux::Repr; use std::collections::hash_map::Entry::Vacant; -use std::io::{mod, File}; +use std::io::{self, File}; use std::os; use std::sync::atomic; use syntax::ast; @@ -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 6ac1c5470cc75..f0ee63c08e8b6 100644 --- a/src/librustc/middle/infer/region_inference/mod.rs +++ b/src/librustc/middle/infer/region_inference/mod.rs @@ -33,7 +33,7 @@ use util::nodemap::{FnvHashMap, FnvHashSet}; use util::ppaux::Repr; use std::cell::{Cell, RefCell}; -use std::cmp::Ordering::{mod, Less, Greater, Equal}; +use std::cmp::Ordering::{self, Less, Greater, Equal}; use std::iter::repeat; use std::u32; use syntax::ast; @@ -42,7 +42,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), @@ -69,13 +69,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, @@ -86,12 +86,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)`: /// @@ -143,7 +143,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 @@ -217,7 +217,7 @@ pub struct RegionVarBindings<'a, 'tcx: 'a> { values: RefCell>>, } -#[deriving(Show)] +#[derive(Show)] #[allow(missing_copy_implementations)] pub struct RegionSnapshot { length: uint, @@ -937,10 +937,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/resolve.rs b/src/librustc/middle/infer/resolve.rs index ca2ae25e6c63a..3ed866d4aba8f 100644 --- a/src/librustc/middle/infer/resolve.rs +++ b/src/librustc/middle/infer/resolve.rs @@ -9,8 +9,8 @@ // except according to those terms. use super::{InferCtxt, fixup_err, fres, unresolved_ty, unresolved_int_ty, unresolved_float_ty}; -use middle::ty::{mod, Ty}; -use middle::ty_fold::{mod, TypeFoldable}; +use middle::ty::{self, Ty}; +use middle::ty_fold::{self, TypeFoldable}; use util::ppaux::Repr; /////////////////////////////////////////////////////////////////////////// diff --git a/src/librustc/middle/infer/sub.rs b/src/librustc/middle/infer/sub.rs index 4bd3308728c10..4f8364fa44a95 100644 --- a/src/librustc/middle/infer/sub.rs +++ b/src/librustc/middle/infer/sub.rs @@ -19,7 +19,7 @@ use super::{TypeTrace, Subtype}; use super::type_variable::{SubtypeOf, SupertypeOf}; use middle::ty::{BuiltinBounds}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::TyVar; use util::ppaux::{Repr}; diff --git a/src/librustc/middle/infer/type_variable.rs b/src/librustc/middle/infer/type_variable.rs index 49a1e6f926312..2aacc863f54c9 100644 --- a/src/librustc/middle/infer/type_variable.rs +++ b/src/librustc/middle/infer/type_variable.rs @@ -12,7 +12,7 @@ pub use self::RelationDir::*; use self::TypeVariableValue::*; use self::UndoEntry::*; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use std::cmp::min; use std::mem; use std::u32; @@ -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..73da96445934c 100644 --- a/src/librustc/middle/infer/unify.rs +++ b/src/librustc/middle/infer/unify.rs @@ -13,7 +13,7 @@ pub use self::VarValue::*; use std::kinds::marker; use middle::ty::{expected_found, IntVarValue}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::infer::{uok, ures}; use middle::infer::InferCtxt; use std::cell::RefCell; @@ -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/intrinsicck.rs b/src/librustc/middle/intrinsicck.rs index 2962b7b7c8e48..e3763689ef41a 100644 --- a/src/librustc/middle/intrinsicck.rs +++ b/src/librustc/middle/intrinsicck.rs @@ -12,7 +12,7 @@ use metadata::csearch; use middle::def::DefFn; use middle::subst::{Subst, Substs, EnumeratedItems}; use middle::ty::{TransmuteRestriction, ctxt, ty_bare_fn}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::ppaux::Repr; use syntax::abi::RustIntrinsic; diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index 78fabcd588a28..bbb11b9f93bbd 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -46,7 +46,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..75d5b4fd7f932 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -120,13 +120,13 @@ use util::nodemap::NodeMap; use std::{fmt, io, uint}; use std::rc::Rc; use std::iter::repeat; -use syntax::ast::{mod, NodeId, Expr}; +use syntax::ast::{self, NodeId, Expr}; use syntax::codemap::{BytePos, original_sp, Span}; -use syntax::parse::token::{mod, special_idents}; +use syntax::parse::token::{self, special_idents}; use syntax::print::pprust::{expr_to_string, block_to_string}; use syntax::ptr::P; use syntax::ast_util; -use syntax::visit::{mod, Visitor, FnKind}; +use syntax::visit::{self, Visitor, FnKind}; /// For use with `propagate_through_loop`. enum LoopKind<'a> { @@ -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 722fe82d41c32..8325cebf1ed75 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -73,7 +73,7 @@ pub use self::categorization::*; use middle::def; use middle::region; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::nodemap::{NodeMap}; use util::ppaux::{Repr}; @@ -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), @@ -1296,13 +1296,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..e6665699b7b7b 100644 --- a/src/librustc/middle/privacy.rs +++ b/src/librustc/middle/privacy.rs @@ -21,7 +21,7 @@ use std::mem::replace; use metadata::csearch; use middle::def; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::{MethodCall, MethodMap, MethodOrigin, MethodParam, MethodTypeParam}; use middle::ty::{MethodStatic, MethodStaticUnboxedClosure, MethodObject, MethodTraitObject}; use util::nodemap::{DefIdSet, NodeMap, NodeSet}; @@ -30,7 +30,7 @@ use syntax::{ast, ast_map}; use syntax::ast_util::{is_local, local_def, PostExpansionMethod}; use syntax::codemap::Span; use syntax::parse::token; -use syntax::visit::{mod, Visitor}; +use syntax::visit::{self, Visitor}; type Context<'a, 'tcx> = (&'a MethodMap<'tcx>, &'a def::ExportMap); @@ -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 0e47f338bb91a..68e257bc0c5ec 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -17,7 +17,7 @@ //! `middle/typeck/infer/region_inference.rs` use session::Session; -use middle::ty::{mod, Ty, FreeRegion}; +use middle::ty::{self, Ty, FreeRegion}; use util::nodemap::{FnvHashMap, FnvHashSet, NodeMap}; use util::common::can_reach; @@ -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..5eb033a01bd58 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -19,7 +19,7 @@ pub use self::DefRegion::*; use self::ScopeChain::*; use session::Session; -use middle::def::{mod, DefMap}; +use middle::def::{self, DefMap}; use middle::region; use middle::subst; use middle::ty; @@ -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 e7971a82119ec..cd29ce28ac174 100644 --- a/src/librustc/middle/subst.rs +++ b/src/librustc/middle/subst.rs @@ -13,8 +13,8 @@ pub use self::ParamSpace::*; pub use self::RegionSubsts::*; -use middle::ty::{mod, Ty}; -use middle::ty_fold::{mod, TypeFoldable, TypeFolder}; +use middle::ty::{self, Ty}; +use middle::ty_fold::{self, TypeFoldable, TypeFolder}; use util::ppaux::Repr; use std::fmt; @@ -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/coherence.rs b/src/librustc/middle/traits/coherence.rs index 6a8b6d49cc0c5..e6805cddae05a 100644 --- a/src/librustc/middle/traits/coherence.rs +++ b/src/librustc/middle/traits/coherence.rs @@ -15,7 +15,7 @@ use super::{Obligation, ObligationCause}; use super::util; use middle::subst::Subst; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::infer::InferCtxt; use std::collections::HashSet; use std::rc::Rc; diff --git a/src/librustc/middle/traits/error_reporting.rs b/src/librustc/middle/traits/error_reporting.rs index 05ea2f9a7d258..59322fcc632e8 100644 --- a/src/librustc/middle/traits/error_reporting.rs +++ b/src/librustc/middle/traits/error_reporting.rs @@ -19,7 +19,7 @@ use super::{ }; use middle::infer::InferCtxt; -use middle::ty::{mod, AsPredicate, ReferencesError, ToPolyTraitRef}; +use middle::ty::{self, AsPredicate, ReferencesError, ToPolyTraitRef}; use syntax::codemap::Span; use util::ppaux::{Repr, UserString}; diff --git a/src/librustc/middle/traits/fulfill.rs b/src/librustc/middle/traits/fulfill.rs index e8a22e3d1d8f8..8bb7012fb075c 100644 --- a/src/librustc/middle/traits/fulfill.rs +++ b/src/librustc/middle/traits/fulfill.rs @@ -10,7 +10,7 @@ use middle::infer::{InferCtxt}; use middle::mem_categorization::Typer; -use middle::ty::{mod, RegionEscape, Ty}; +use middle::ty::{self, RegionEscape, Ty}; use std::collections::HashSet; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::default::Default; diff --git a/src/librustc/middle/traits/mod.rs b/src/librustc/middle/traits/mod.rs index 1a1d52a047c84..ce926fd8d10de 100644 --- a/src/librustc/middle/traits/mod.rs +++ b/src/librustc/middle/traits/mod.rs @@ -17,7 +17,7 @@ pub use self::ObligationCauseCode::*; use middle::mem_categorization::Typer; use middle::subst; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::infer::InferCtxt; use std::slice::Iter; use std::rc::Rc; @@ -63,7 +63,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, @@ -74,7 +74,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, @@ -89,7 +89,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, @@ -126,7 +126,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 @@ -144,7 +144,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, @@ -158,7 +158,7 @@ pub struct FulfillmentError<'tcx> { pub code: FulfillmentErrorCode<'tcx> } -#[deriving(Clone)] +#[derive(Clone)] pub enum FulfillmentErrorCode<'tcx> { CodeSelectionError(SelectionError<'tcx>), CodeProjectionError(MismatchedProjectionTypes<'tcx>), @@ -212,7 +212,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>), @@ -247,21 +247,21 @@ 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 } /// A vtable for some object-safe trait `Foo` automatically derived /// for the object type `Foo`. -#[deriving(PartialEq,Eq,Clone)] +#[derive(PartialEq,Eq,Clone)] pub struct VtableObjectData<'tcx> { pub object_ty: Ty<'tcx>, } diff --git a/src/librustc/middle/traits/object_safety.rs b/src/librustc/middle/traits/object_safety.rs index 6b7bf82af9293..8880cb7ce733f 100644 --- a/src/librustc/middle/traits/object_safety.rs +++ b/src/librustc/middle/traits/object_safety.rs @@ -20,9 +20,9 @@ use super::supertraits; use super::elaborate_predicates; -use middle::subst::{mod, SelfSpace}; +use middle::subst::{self, SelfSpace}; use middle::traits; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use std::rc::Rc; use syntax::ast; use util::ppaux::Repr; @@ -36,7 +36,7 @@ pub enum ObjectSafetyViolation<'tcx> { } /// Reasons a method might not be object-safe. -#[deriving(Copy,Clone,Show)] +#[derive(Copy,Clone,Show)] pub enum MethodViolationCode { /// e.g., `fn(self)` ByValueSelf, diff --git a/src/librustc/middle/traits/project.rs b/src/librustc/middle/traits/project.rs index d7f570df07278..d5b41d2380628 100644 --- a/src/librustc/middle/traits/project.rs +++ b/src/librustc/middle/traits/project.rs @@ -21,9 +21,9 @@ use super::VtableImplData; use middle::infer; use middle::subst::Subst; -use middle::ty::{mod, AsPredicate, ReferencesError, RegionEscape, +use middle::ty::{self, AsPredicate, ReferencesError, RegionEscape, HasProjectionTypes, ToPolyTraitRef, Ty}; -use middle::ty_fold::{mod, TypeFoldable, TypeFolder}; +use middle::ty_fold::{self, TypeFoldable, TypeFolder}; use std::rc::Rc; use util::ppaux::Repr; @@ -45,7 +45,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 c6fccab95a4ca..f499cf61301aa 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -33,7 +33,7 @@ use super::{util}; use middle::fast_reject; use middle::mem_categorization::Typer; use middle::subst::{Subst, Substs, TypeSpace, VecPerParamSpace}; -use middle::ty::{mod, AsPredicate, RegionEscape, ToPolyTraitRef, Ty}; +use middle::ty::{self, AsPredicate, RegionEscape, ToPolyTraitRef, Ty}; use middle::infer; use middle::infer::{InferCtxt, TypeFreshener}; use middle::ty_fold::TypeFoldable; @@ -83,7 +83,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>>>>, @@ -95,7 +95,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. @@ -130,7 +130,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>), @@ -171,7 +171,7 @@ enum BuiltinBoundConditions<'tcx> { AmbiguousBuiltin } -#[deriving(Show)] +#[derive(Show)] enum EvaluationResult<'tcx> { EvaluatedToOk, EvaluatedToAmbig, diff --git a/src/librustc/middle/traits/util.rs b/src/librustc/middle/traits/util.rs index e4578f7476329..ab8888f9a33eb 100644 --- a/src/librustc/middle/traits/util.rs +++ b/src/librustc/middle/traits/util.rs @@ -10,7 +10,7 @@ use middle::subst::{Substs, VecPerParamSpace}; use middle::infer::InferCtxt; -use middle::ty::{mod, Ty, AsPredicate, ToPolyTraitRef}; +use middle::ty::{self, Ty, AsPredicate, ToPolyTraitRef}; use std::collections::HashSet; use std::fmt; use std::rc::Rc; diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 20ded8ad0e0c1..d168e84a01ccd 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -46,7 +46,7 @@ use lint; use metadata::csearch; use middle; use middle::const_eval; -use middle::def::{mod, DefMap, ExportMap}; +use middle::def::{self, DefMap, ExportMap}; use middle::dependency_format; use middle::lang_items::{FnTraitLangItem, FnMutTraitLangItem}; use middle::lang_items::{FnOnceTraitLangItem, TyDescStructLangItem}; @@ -55,10 +55,10 @@ use middle::region; use middle::resolve_lifetime; use middle::infer; use middle::stability; -use middle::subst::{mod, Subst, Substs, VecPerParamSpace}; +use middle::subst::{self, Subst, Substs, VecPerParamSpace}; use middle::traits; use middle::ty; -use middle::ty_fold::{mod, TypeFoldable, TypeFolder}; +use middle::ty_fold::{self, TypeFoldable, TypeFolder}; use middle::ty_walk::TypeWalker; use util::ppaux::{note_and_explain_region, bound_region_ptr_to_string}; use util::ppaux::{trait_store_to_string, ty_to_string}; @@ -70,8 +70,8 @@ use util::nodemap::{FnvHashMap}; use arena::TypedArena; use std::borrow::BorrowFrom; use std::cell::{Cell, RefCell}; -use std::cmp::{mod, Ordering}; -use std::fmt::{mod, Show}; +use std::cmp::{self, Ordering}; +use std::fmt::{self, Show}; use std::hash::{Hash, sip, Writer}; use std::mem; use std::ops; @@ -84,10 +84,10 @@ use syntax::ast::{CrateNum, DefId, Ident, ItemTrait, LOCAL_CRATE}; use syntax::ast::{MutImmutable, MutMutable, Name, NamedField, NodeId}; use syntax::ast::{Onceness, StmtExpr, StmtSemi, StructField, UnnamedField}; use syntax::ast::{Visibility}; -use syntax::ast_util::{mod, is_local, lit_is_str, local_def, PostExpansionMethod}; -use syntax::attr::{mod, AttrMetaMethods}; +use syntax::ast_util::{self, is_local, lit_is_str, local_def, PostExpansionMethod}; +use syntax::attr::{self, AttrMetaMethods}; use syntax::codemap::Span; -use syntax::parse::token::{mod, InternedString, special_idents}; +use syntax::parse::token::{self, InternedString, special_idents}; use syntax::{ast, ast_map}; pub type Disr = u64; @@ -108,13 +108,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), @@ -129,7 +129,7 @@ impl ImplOrTraitItemContainer { } } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub enum ImplOrTraitItem<'tcx> { MethodTraitItem(Rc>), TypeTraitItem(Rc), @@ -174,7 +174,7 @@ impl<'tcx> ImplOrTraitItem<'tcx> { } } -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub enum ImplOrTraitItemId { MethodTraitItemId(ast::DefId), TypeTraitItemId(ast::DefId), @@ -189,7 +189,7 @@ impl ImplOrTraitItemId { } } -#[deriving(Clone, Show)] +#[derive(Clone, Show)] pub struct Method<'tcx> { pub name: ast::Name, pub generics: ty::Generics<'tcx>, @@ -233,7 +233,7 @@ impl<'tcx> Method<'tcx> { } } -#[deriving(Clone, Copy, Show)] +#[derive(Clone, Copy, Show)] pub struct AssociatedType { pub name: ast::Name, pub vis: ast::Visibility, @@ -241,13 +241,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, @@ -255,7 +255,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, @@ -265,26 +265,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 @@ -292,14 +292,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), @@ -309,13 +309,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. @@ -432,13 +432,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), @@ -456,7 +456,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 @@ -469,7 +469,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>, @@ -487,7 +487,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>, @@ -506,13 +506,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), @@ -551,7 +551,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 @@ -596,7 +596,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, @@ -858,7 +858,7 @@ macro_rules! sty_debug_print { // variable names. mod inner { use middle::ty; - #[deriving(Copy)] + #[derive(Copy)] struct DebugStat { total: uint, region_infer: uint, @@ -926,7 +926,7 @@ impl<'tcx> ctxt<'tcx> { } } -#[deriving(Show)] +#[derive(Show)] pub struct TyS<'tcx> { pub sty: sty<'tcx>, pub flags: TypeFlags, @@ -1032,14 +1032,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, @@ -1049,7 +1049,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 @@ -1070,7 +1070,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>, @@ -1079,7 +1079,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, @@ -1125,7 +1125,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`. @@ -1133,7 +1133,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 @@ -1174,13 +1174,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, @@ -1273,7 +1273,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, @@ -1298,7 +1298,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`". @@ -1307,7 +1307,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) @@ -1329,7 +1329,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, @@ -1377,7 +1377,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>, @@ -1449,7 +1449,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>, @@ -1487,16 +1487,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, @@ -1504,14 +1504,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), @@ -1548,7 +1548,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, @@ -1561,7 +1561,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, @@ -1570,7 +1570,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 { @@ -1608,27 +1608,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), @@ -1645,7 +1645,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, @@ -1653,7 +1653,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) @@ -1728,7 +1728,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, @@ -1738,7 +1738,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, @@ -1755,7 +1755,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, @@ -1787,7 +1787,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` @@ -1808,7 +1808,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> } @@ -1834,11 +1834,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; @@ -1856,7 +1856,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>, @@ -1872,7 +1872,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>, @@ -2008,7 +2008,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>, } @@ -2057,7 +2057,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<'a, 'tcx:'a> { pub tcx: &'a ctxt<'tcx>, @@ -2205,7 +2205,7 @@ impl<'a, 'tcx> ParameterEnvironment<'a, '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> @@ -2234,13 +2234,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>, @@ -2248,7 +2248,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, @@ -3129,7 +3129,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 } @@ -3733,7 +3733,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, @@ -4505,7 +4505,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, @@ -5091,7 +5091,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, @@ -5186,7 +5186,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>, @@ -5277,7 +5277,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) @@ -5712,7 +5712,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, @@ -6643,7 +6643,7 @@ impl<'a,'tcx> UnboxedClosureTyper<'tcx> for ty::ParameterEnvironment<'a,'tcx> { /// The category of explicit self. -#[deriving(Clone, Copy, Eq, PartialEq, Show)] +#[derive(Clone, Copy, Eq, PartialEq, Show)] pub enum ExplicitSelfCategory { StaticExplicitSelfCategory, ByValueExplicitSelfCategory, @@ -6712,7 +6712,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, @@ -6989,7 +6989,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/middle/ty_fold.rs b/src/librustc/middle/ty_fold.rs index abbf530529bb2..9a66b98ee5841 100644 --- a/src/librustc/middle/ty_fold.rs +++ b/src/librustc/middle/ty_fold.rs @@ -36,7 +36,7 @@ use middle::subst; use middle::subst::VecPerParamSpace; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::traits; use std::rc::Rc; use syntax::owned_slice::OwnedSlice; diff --git a/src/librustc/middle/ty_walk.rs b/src/librustc/middle/ty_walk.rs index 12df36c10fc09..6070a4208f663 100644 --- a/src/librustc/middle/ty_walk.rs +++ b/src/librustc/middle/ty_walk.rs @@ -10,7 +10,7 @@ //! An iterator over the type substructure. -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use std::iter::Iterator; pub struct TypeWalker<'tcx> { diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index f299ea939ed2b..01bd114474c9e 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 { @@ -674,10 +674,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/mod.rs b/src/librustc/session/mod.rs index 86a3a6001f966..770e8d73ec761 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -17,7 +17,7 @@ use util::nodemap::NodeMap; use syntax::ast::NodeId; use syntax::codemap::Span; -use syntax::diagnostic::{mod, Emitter}; +use syntax::diagnostic::{self, Emitter}; use syntax::diagnostics; use syntax::feature_gate; use syntax::parse; diff --git a/src/librustc/session/search_paths.rs b/src/librustc/session/search_paths.rs index 14ea2d3d33a26..9bff54352179e 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 b7b74fe2314f2..d53f97c3a0423 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -77,7 +77,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, @@ -100,7 +100,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 17a3f4a88e5c0..cb77519671cf5 100644 --- a/src/librustc_borrowck/borrowck/check_loans.rs +++ b/src/librustc_borrowck/borrowck/check_loans.rs @@ -213,7 +213,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 8d3aa397f3061..95c5d9415a125 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 d81974d1ae038..75545634b40cf 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -25,7 +25,7 @@ use rustc::middle::dataflow::DataFlowOperator; use rustc::middle::expr_use_visitor as euv; use rustc::middle::mem_categorization as mc; use rustc::middle::region; -use rustc::middle::ty::{mod, Ty}; +use rustc::middle::ty::{self, Ty}; use rustc::util::ppaux::{note_and_explain_region, Repr, UserString}; use std::rc::Rc; use std::string::String; @@ -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 ac6b962d64704..388cbf2f18b7c 100644 --- a/src/librustc_borrowck/graphviz.rs +++ b/src/librustc_borrowck/graphviz.rs @@ -26,7 +26,7 @@ use rustc::middle::dataflow; use std::rc::Rc; use std::borrow::IntoCow; -#[deriving(Show, Copy)] +#[derive(Show, Copy)] pub enum Variant { Loans, Moves, diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index a92c2fe2ccbd8..1455aa3c99bb3 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -9,7 +9,7 @@ // except according to those terms. use rustc::session::Session; -use rustc::session::config::{mod, Input, OutputFilenames}; +use rustc::session::config::{self, Input, OutputFilenames}; use rustc::session::search_paths::PathKind; use rustc::lint; use rustc::metadata::creader; diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs index 561099550cee3..d972229e7c75b 100644 --- a/src/librustc_driver/pretty.rs +++ b/src/librustc_driver/pretty.rs @@ -23,25 +23,25 @@ use rustc::middle::ty; use rustc::middle::cfg; use rustc::middle::cfg::graphviz::LabelledCFG; use rustc::session::Session; -use rustc::session::config::{mod, Input}; +use rustc::session::config::{self, Input}; use rustc::util::ppaux; use rustc_borrowck as borrowck; use rustc_borrowck::graphviz as borrowck_dot; use syntax::ast; -use syntax::ast_map::{mod, blocks, NodePrinter}; +use syntax::ast_map::{self, blocks, NodePrinter}; use syntax::codemap; -use syntax::fold::{mod, Folder}; +use syntax::fold::{self, Folder}; use syntax::print::{pp, pprust}; use syntax::ptr::P; use graphviz as dot; -use std::io::{mod, MemReader}; +use std::io::{self, 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, @@ -323,7 +323,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_driver/test.rs b/src/librustc_driver/test.rs index eddcc75006899..ab41ade576a58 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -15,19 +15,19 @@ use diagnostic::Emitter; use driver; use rustc_resolve as resolve; use rustc_typeck::middle::lang_items; -use rustc_typeck::middle::region::{mod, CodeExtent}; +use rustc_typeck::middle::region::{self, CodeExtent}; use rustc_typeck::middle::resolve_lifetime; use rustc_typeck::middle::stability; use rustc_typeck::middle::subst; use rustc_typeck::middle::subst::Subst; -use rustc_typeck::middle::ty::{mod, Ty}; +use rustc_typeck::middle::ty::{self, Ty}; use rustc_typeck::middle::infer::combine::Combine; use rustc_typeck::middle::infer; use rustc_typeck::middle::infer::lub::Lub; use rustc_typeck::middle::infer::glb::Glb; use rustc_typeck::middle::infer::sub::Sub; use rustc_typeck::util::ppaux::{ty_to_string, Repr, UserString}; -use rustc::session::{mod,config}; +use rustc::session::{self,config}; use syntax::{abi, ast, ast_map}; use syntax::codemap; use syntax::codemap::{Span, CodeMap, DUMMY_SP}; 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 e16c27a145093..2ec5f37634afb 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 aa3ac83c0275f..d7c1a4fe17b2f 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -15,13 +15,13 @@ use {DefModifiers, PUBLIC, IMPORTABLE}; use ImportDirective; -use ImportDirectiveSubclass::{mod, SingleImport, GlobImport}; +use ImportDirectiveSubclass::{self, SingleImport, GlobImport}; use ImportResolution; use Module; use ModuleKind::*; use Namespace::{TypeNS, ValueNS}; use NameBindings; -use ParentLink::{mod, ModuleParentLink, BlockParentLink}; +use ParentLink::{self, ModuleParentLink, BlockParentLink}; use Resolver; use RibKind::*; use Shadowable; @@ -55,11 +55,11 @@ use syntax::ast::{ViewItemUse, ViewPathGlob, ViewPathList, ViewPathSimple}; use syntax::ast::{Visibility}; use syntax::ast::TyPath; use syntax::ast; -use syntax::ast_util::{mod, PostExpansionMethod, local_def}; +use syntax::ast_util::{self, PostExpansionMethod, local_def}; use syntax::attr::AttrMetaMethods; -use syntax::parse::token::{mod, special_idents}; +use syntax::parse::token::{self, special_idents}; use syntax::codemap::{Span, DUMMY_SP}; -use syntax::visit::{mod, Visitor}; +use syntax::visit::{self, Visitor}; use std::mem::replace; use std::ops::{Deref, DerefMut}; @@ -67,7 +67,7 @@ use std::rc::Rc; // 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, @@ -76,7 +76,7 @@ enum DuplicateCheckingMode { OverwriteDuplicates } -#[deriving(Copy, PartialEq)] +#[derive(Copy, PartialEq)] enum NamespaceError { NoError, ModuleError, diff --git a/src/librustc_resolve/check_unused.rs b/src/librustc_resolve/check_unused.rs index 1bfe4c0407afb..26b1058d18341 100644 --- a/src/librustc_resolve/check_unused.rs +++ b/src/librustc_resolve/check_unused.rs @@ -28,7 +28,7 @@ use syntax::ast; use syntax::ast::{ViewItem, ViewItemExternCrate, ViewItemUse}; use syntax::ast::{ViewPathGlob, ViewPathList, ViewPathSimple}; use syntax::codemap::{Span, DUMMY_SP}; -use syntax::visit::{mod, Visitor}; +use syntax::visit::{self, Visitor}; struct UnusedImportCheckVisitor<'a, 'b:'a, 'tcx:'b> { resolver: &'a mut Resolver<'b, 'tcx> diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 4ac9224969ca2..3be7aa294f17a 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -81,10 +81,10 @@ use syntax::ast_map; use syntax::ast_util::{PostExpansionMethod, local_def, walk_pat}; use syntax::attr::AttrMetaMethods; use syntax::ext::mtwt; -use syntax::parse::token::{mod, special_names, special_idents}; +use syntax::parse::token::{self, special_names, special_idents}; use syntax::codemap::{Span, Pos}; use syntax::owned_slice::OwnedSlice; -use syntax::visit::{mod, Visitor}; +use syntax::visit::{self, Visitor}; use std::collections::{HashMap, HashSet}; use std::collections::hash_map::Entry::{Occupied, Vacant}; @@ -98,7 +98,7 @@ mod check_unused; mod record_exports; mod build_reduced_graph; -#[deriving(Copy)] +#[derive(Copy)] struct BindingInfo { span: Span, binding_mode: BindingMode, @@ -107,14 +107,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 @@ -123,7 +123,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 @@ -180,7 +180,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 @@ -209,7 +209,7 @@ enum FallbackSuggestion { TraitMethod(String), } -#[deriving(Copy)] +#[derive(Copy)] enum TypeParameters<'a> { NoTypeParameters, HasTypeParameters( @@ -229,7 +229,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, @@ -253,13 +253,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 @@ -270,7 +270,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, @@ -280,7 +280,7 @@ enum NameSearchType { PathSearch, } -#[deriving(Copy)] +#[derive(Copy)] enum BareIdentifierPatternResolution { FoundStructOrEnumVariant(Def, LastPrivate), FoundConst(Def, LastPrivate), @@ -288,7 +288,7 @@ enum BareIdentifierPatternResolution { } /// One local scope. -#[deriving(Show)] +#[derive(Show)] struct Rib { bindings: HashMap, kind: RibKind, @@ -304,14 +304,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, @@ -341,7 +341,7 @@ impl ImportDirective { } /// The item that an import resolves to. -#[deriving(Clone,Show)] +#[derive(Clone,Show)] struct Target { target_module: Rc, bindings: Rc, @@ -362,7 +362,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 @@ -442,7 +442,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), @@ -450,7 +450,7 @@ enum ParentLink { } /// The type of module this is. -#[deriving(Copy, PartialEq, Show)] +#[derive(Copy, PartialEq, Show)] enum ModuleKind { NormalModuleKind, TraitModuleKind, @@ -542,7 +542,7 @@ impl fmt::Show for Module { } bitflags! { - #[deriving(Show)] + #[derive(Show)] flags DefModifiers: u8 { const PUBLIC = 0b0000_0001, const IMPORTABLE = 0b0000_0010, @@ -550,7 +550,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>, @@ -559,7 +559,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, @@ -568,14 +568,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 { ... } @@ -904,7 +904,7 @@ struct Resolver<'a, 'tcx:'a> { used_crates: HashSet, } -#[deriving(PartialEq)] +#[derive(PartialEq)] enum FallbackChecks { Everything, OnlyTraitAndStatics @@ -4834,7 +4834,7 @@ pub struct CrateMap { pub glob_map: Option } -#[deriving(PartialEq,Copy)] +#[derive(PartialEq,Copy)] pub enum MakeGlobMap { Yes, No diff --git a/src/librustc_resolve/record_exports.rs b/src/librustc_resolve/record_exports.rs index ff415750d6481..84fd3c936719b 100644 --- a/src/librustc_resolve/record_exports.rs +++ b/src/librustc_resolve/record_exports.rs @@ -19,7 +19,7 @@ // processing. use {Module, NameBindings, Resolver}; -use Namespace::{mod, TypeNS, ValueNS}; +use Namespace::{self, TypeNS, ValueNS}; use build_reduced_graph; diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index c3c97616ea838..8fbeadc55b387 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -22,7 +22,7 @@ use metadata::common::LinkMeta; use metadata::{encoder, cstore, filesearch, csearch, creader}; use metadata::filesearch::FileDoesntMatch; use trans::{CrateContext, CrateTranslation, gensym_name}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::common::time; use util::ppaux; use util::sha2::{Digest, Sha256}; diff --git a/src/librustc_trans/back/lto.rs b/src/librustc_trans/back/lto.rs index 7cf4bafe032e0..c6488ec6638a3 100644 --- a/src/librustc_trans/back/lto.rs +++ b/src/librustc_trans/back/lto.rs @@ -10,7 +10,7 @@ use super::link; use super::write; -use rustc::session::{mod, config}; +use rustc::session::{self, config}; use llvm; use llvm::archive_ro::ArchiveRO; use llvm::{ModuleRef, TargetMachineRef, True, False}; diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index c1e470aa4e8b7..33011d9e35c10 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -34,7 +34,7 @@ use std::sync::mpsc::channel; 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, @@ -86,7 +86,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>>, } @@ -256,7 +256,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/mod.rs b/src/librustc_trans/save/mod.rs index 73961f00d703a..55bdff8191011 100644 --- a/src/librustc_trans/save/mod.rs +++ b/src/librustc_trans/save/mod.rs @@ -30,20 +30,20 @@ use session::Session; use middle::def; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use std::cell::Cell; -use std::io::{mod, File, fs}; +use std::io::{self, File, fs}; use std::os; -use syntax::ast_util::{mod, PostExpansionMethod}; -use syntax::ast::{mod, NodeId, DefId}; +use syntax::ast_util::{self, PostExpansionMethod}; +use syntax::ast::{self, NodeId, DefId}; use syntax::ast_map::NodeItem; use syntax::attr; use syntax::codemap::*; -use syntax::parse::token::{mod, get_ident, keywords}; +use syntax::parse::token::{self, get_ident, keywords}; use syntax::owned_slice::OwnedSlice; -use syntax::visit::{mod, Visitor}; +use syntax::visit::{self, Visitor}; use syntax::print::pprust::{path_to_string,ty_to_string}; use syntax::ptr::P; 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 19781a51d578b..50cbe664b9079 100644 --- a/src/librustc_trans/trans/_match.rs +++ b/src/librustc_trans/trans/_match.rs @@ -193,7 +193,7 @@ use llvm::{ValueRef, BasicBlockRef}; use middle::check_match::StaticInliner; use middle::check_match; use middle::const_eval; -use middle::def::{mod, DefMap}; +use middle::def::{self, DefMap}; use middle::expr_use_visitor as euv; use middle::lang_items::StrEqFnLangItem; use middle::mem_categorization as mc; @@ -204,15 +204,15 @@ use trans::build::{AddCase, And, BitCast, Br, CondBr, GEPi, InBoundsGEP, Load}; use trans::build::{Mul, Not, Store, Sub, add_comment}; use trans::build; use trans::callee; -use trans::cleanup::{mod, CleanupMethods}; +use trans::cleanup::{self, CleanupMethods}; use trans::common::*; use trans::consts; use trans::datum::*; -use trans::expr::{mod, Dest}; +use trans::expr::{self, Dest}; use trans::tvec; use trans::type_of; use trans::debuginfo; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use session::config::FullDebugInfo; use util::common::indenter; use util::nodemap::FnvHashMap; @@ -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 85a7ec3306950..223df5d3a5785 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -61,7 +61,7 @@ use trans::datum; use trans::machine; use trans::type_::Type; use trans::type_of; -use middle::ty::{mod, Ty, UnboxedClosureTyper}; +use middle::ty::{self, Ty, UnboxedClosureTyper}; use middle::ty::Disr; use syntax::ast; use syntax::attr; @@ -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. @@ -469,7 +469,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 225f6f116dae3..58cb2ebd2566c 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -43,8 +43,8 @@ use middle::lang_items::{LangItem, ExchangeMallocFnLangItem, StartFnLangItem}; use middle::subst; use middle::weak_lang_items; use middle::subst::{Subst, Substs}; -use middle::ty::{mod, Ty, UnboxedClosureTyper}; -use session::config::{mod, NoDebugInfo, FullDebugInfo}; +use middle::ty::{self, Ty, UnboxedClosureTyper}; +use session::config::{self, NoDebugInfo, FullDebugInfo}; use session::Session; use trans::_match; use trans::adt; @@ -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>, @@ -1784,7 +1784,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, @@ -2206,7 +2206,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 abe5af44c3f56..0e38dd0e5b596 100644 --- a/src/librustc_trans/trans/cabi.rs +++ b/src/librustc_trans/trans/cabi.rs @@ -21,7 +21,7 @@ use trans::cabi_aarch64; 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 @@ -36,7 +36,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..f001786bec4e9 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/trans/callee.rs @@ -48,7 +48,7 @@ use trans::meth; use trans::monomorphize; use trans::type_::Type; use trans::type_of; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::MethodCall; use util::ppaux::Repr; use util::ppaux::ty_to_string; @@ -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..59ba56bbbc857 100644 --- a/src/librustc_trans/trans/cleanup.rs +++ b/src/librustc_trans/trans/cleanup.rs @@ -27,7 +27,7 @@ use trans::glue; // Temporary due to slicing syntax hacks (KILLME) //use middle::region; use trans::type_::Type; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use std::fmt; use syntax::ast; use util::ppaux::Repr; @@ -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..cb5302f7234f9 100644 --- a/src/librustc_trans/trans/closure.rs +++ b/src/librustc_trans/trans/closure.rs @@ -22,10 +22,10 @@ use trans::common::*; use trans::datum::{Datum, DatumBlock, Expr, Lvalue, rvalue_scratch_datum}; use trans::debuginfo; use trans::expr; -use trans::monomorphize::{mod, MonoId}; +use trans::monomorphize::{self, MonoId}; use trans::type_of::*; use trans::type_::Type; -use middle::ty::{mod, Ty, UnboxedClosureTyper}; +use middle::ty::{self, Ty, UnboxedClosureTyper}; use middle::subst::{Substs}; use session::config::FullDebugInfo; use util::ppaux::Repr; @@ -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 6efdcc2f0fa0f..87a1862186a4d 100644 --- a/src/librustc_trans/trans/common.rs +++ b/src/librustc_trans/trans/common.rs @@ -24,7 +24,7 @@ use middle::infer; use middle::lang_items::LangItem; use middle::mem_categorization as mc; use middle::region; -use middle::subst::{mod, Subst, Substs}; +use middle::subst::{self, Subst, Substs}; use trans::base; use trans::build; use trans::cleanup; @@ -35,7 +35,7 @@ use trans::monomorphize; use trans::type_::Type; use trans::type_of; use middle::traits; -use middle::ty::{mod, HasProjectionTypes, Ty}; +use middle::ty::{self, HasProjectionTypes, Ty}; use middle::ty_fold; use middle::ty_fold::{TypeFolder, TypeFoldable}; use util::ppaux::Repr; @@ -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, @@ -1086,7 +1086,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/consts.rs b/src/librustc_trans/trans/consts.rs index 347ec100ae7ad..4f8554195e569 100644 --- a/src/librustc_trans/trans/consts.rs +++ b/src/librustc_trans/trans/consts.rs @@ -17,11 +17,11 @@ use llvm::{IntEQ, IntNE, IntUGT, IntUGE, IntULT, IntULE, IntSGT, IntSGE, IntSLT, use metadata::csearch; use middle::{const_eval, def}; use trans::{adt, closure, consts, debuginfo, expr, inline, machine}; -use trans::base::{mod, push_ctxt}; +use trans::base::{self, push_ctxt}; use trans::common::*; use trans::type_::Type; use trans::type_of; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::ppaux::{Repr, ty_to_string}; use std::c_str::ToCStr; diff --git a/src/librustc_trans/trans/context.rs b/src/librustc_trans/trans/context.rs index 67aecde661891..e5a0e2e9234d5 100644 --- a/src/librustc_trans/trans/context.rs +++ b/src/librustc_trans/trans/context.rs @@ -22,7 +22,7 @@ use trans::common::{ExternMap,tydesc_info,BuilderRef_res}; use trans::debuginfo; use trans::monomorphize::MonoId; use trans::type_::{Type, TypeNames}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use session::config::NoDebugInfo; use session::Session; use util::ppaux::Repr; diff --git a/src/librustc_trans/trans/datum.rs b/src/librustc_trans/trans/datum.rs index 72074040a2c67..d73b3f6b4e420 100644 --- a/src/librustc_trans/trans/datum.rs +++ b/src/librustc_trans/trans/datum.rs @@ -23,7 +23,7 @@ use trans::cleanup::CleanupMethods; use trans::expr; use trans::tvec; use trans::type_of; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::ppaux::{ty_to_string}; use std::fmt; @@ -34,7 +34,7 @@ use syntax::codemap::DUMMY_SP; /// 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. @@ -52,7 +52,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 @@ -64,10 +64,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 } @@ -83,7 +83,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 1a0007cf0fcdd..916fcbfe13ef7 100644 --- a/src/librustc_trans/trans/debuginfo.rs +++ b/src/librustc_trans/trans/debuginfo.rs @@ -194,15 +194,15 @@ use llvm; use llvm::{ModuleRef, ContextRef, ValueRef}; use llvm::debuginfo::*; use metadata::csearch; -use middle::subst::{mod, Substs}; -use trans::{mod, adt, machine, type_of}; +use middle::subst::{self, Substs}; +use trans::{self, adt, machine, type_of}; use trans::common::*; use trans::_match::{BindingInfo, TrByCopy, TrByMove, TrByRef}; use trans::monomorphize; use trans::type_::Type; -use middle::ty::{mod, Ty, UnboxedClosureTyper}; +use middle::ty::{self, Ty, UnboxedClosureTyper}; use middle::pat_util; -use session::config::{mod, FullDebugInfo, LimitedDebugInfo, NoDebugInfo}; +use session::config::{self, FullDebugInfo, LimitedDebugInfo, NoDebugInfo}; use util::nodemap::{DefIdMap, NodeMap, FnvHashMap, FnvHashSet}; use util::ppaux; @@ -215,7 +215,7 @@ use syntax::util::interner::Interner; use syntax::codemap::{Span, Pos}; use syntax::{ast, codemap, ast_util, ast_map, attr}; use syntax::ast_util::PostExpansionMethod; -use syntax::parse::token::{mod, special_idents}; +use syntax::parse::token::{self, special_idents}; const DW_LANG_RUST: c_uint = 0x9000; @@ -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..c525e6fcfe36a 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -36,14 +36,14 @@ pub use self::Dest::*; use self::lazy_binop_ty::*; use back::abi; -use llvm::{mod, ValueRef}; +use llvm::{self, ValueRef}; use middle::def; use middle::mem_categorization::Typer; -use middle::subst::{mod, Substs}; +use middle::subst::{self, Substs}; use trans::{_match, adt, asm, base, callee, closure, consts, controlflow}; use trans::base::*; use trans::build::*; -use trans::cleanup::{mod, CleanupMethods}; +use trans::cleanup::{self, CleanupMethods}; use trans::common::*; use trans::datum::*; use trans::debuginfo; @@ -56,7 +56,7 @@ use trans::type_of; use middle::ty::{struct_fields, tup_fields}; use middle::ty::{AdjustDerefRef, AdjustReifyFnPointer, AdjustAddEnv, AutoUnsafe}; use middle::ty::{AutoPtr}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::MethodCall; use util::common::indenter; use util::ppaux::Repr; @@ -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/foreign.rs b/src/librustc_trans/trans/foreign.rs index 99dc971ed945d..a4cfec791d817 100644 --- a/src/librustc_trans/trans/foreign.rs +++ b/src/librustc_trans/trans/foreign.rs @@ -23,7 +23,7 @@ use trans::monomorphize; use trans::type_::Type; use trans::type_of::*; use trans::type_of; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::subst::{Substs}; use std::cmp; use std::c_str::ToCStr; diff --git a/src/librustc_trans/trans/glue.rs b/src/librustc_trans/trans/glue.rs index ab5c670ef5a2d..0ff53a1af7118 100644 --- a/src/librustc_trans/trans/glue.rs +++ b/src/librustc_trans/trans/glue.rs @@ -34,7 +34,7 @@ use trans::machine::*; use trans::tvec; use trans::type_::Type; use trans::type_of::{type_of, sizing_type_of, align_of}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::ppaux::{ty_to_short_str, Repr}; use util::ppaux; diff --git a/src/librustc_trans/trans/intrinsic.rs b/src/librustc_trans/trans/intrinsic.rs index 94149325018fa..6e71653891181 100644 --- a/src/librustc_trans/trans/intrinsic.rs +++ b/src/librustc_trans/trans/intrinsic.rs @@ -28,7 +28,7 @@ use trans::type_of; use trans::machine; use trans::machine::llsize_of; use trans::type_::Type; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use syntax::abi::RustIntrinsic; use syntax::ast; use syntax::parse::token; diff --git a/src/librustc_trans/trans/meth.rs b/src/librustc_trans/trans/meth.rs index f0588b3082ab6..ca17f3558aef2 100644 --- a/src/librustc_trans/trans/meth.rs +++ b/src/librustc_trans/trans/meth.rs @@ -11,7 +11,7 @@ use arena::TypedArena; use back::abi; use back::link; -use llvm::{mod, ValueRef, get_param}; +use llvm::{self, ValueRef, get_param}; use metadata::csearch; use middle::subst::{Subst, Substs}; use middle::subst::VecPerParamSpace; @@ -30,7 +30,7 @@ use trans::glue; use trans::machine; use trans::type_::Type; use trans::type_of::*; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::MethodCall; use util::ppaux::Repr; diff --git a/src/librustc_trans/trans/mod.rs b/src/librustc_trans/trans/mod.rs index 3030714f4e989..72c4def15a215 100644 --- a/src/librustc_trans/trans/mod.rs +++ b/src/librustc_trans/trans/mod.rs @@ -55,7 +55,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 cc259e6765c34..51a6bc3bfd5de 100644 --- a/src/librustc_trans/trans/monomorphize.rs +++ b/src/librustc_trans/trans/monomorphize.rs @@ -23,7 +23,7 @@ use trans::base::{trans_fn, decl_internal_rust_fn}; use trans::base; use trans::common::*; use trans::foreign; -use middle::ty::{mod, HasProjectionTypes, Ty}; +use middle::ty::{self, HasProjectionTypes, Ty}; use util::ppaux::Repr; use syntax::abi; @@ -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..f8d0d4f5c7bf0 100644 --- a/src/librustc_trans/trans/tvec.rs +++ b/src/librustc_trans/trans/tvec.rs @@ -27,7 +27,7 @@ use trans::machine; use trans::machine::{nonzero_llsize_of, llsize_of_alloc}; use trans::type_::Type; use trans::type_of; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::ppaux::ty_to_string; use syntax::ast; @@ -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..fbbf2ac80d51e 100644 --- a/src/librustc_trans/trans/type_of.rs +++ b/src/librustc_trans/trans/type_of.rs @@ -17,7 +17,7 @@ use trans::adt; use trans::common::*; use trans::foreign; use trans::machine; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use util::ppaux; use util::ppaux::Repr; @@ -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 028e2154303e2..b6fd2eb57be27 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/astconv.rs b/src/librustc_typeck/astconv.rs index dee9aafd06d7b..1d62733875e00 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -53,13 +53,13 @@ use middle::def; use middle::resolve_lifetime as rl; use middle::subst::{FnSpace, TypeSpace, SelfSpace, Subst, Substs}; use middle::subst::{VecPerParamSpace}; -use middle::ty::{mod, RegionEscape, Ty}; -use rscope::{mod, UnelidableRscope, RegionScope, SpecificRscope, +use middle::ty::{self, RegionEscape, Ty}; +use rscope::{self, UnelidableRscope, RegionScope, SpecificRscope, ShiftedRscope, BindingRscope}; use TypeAndSubsts; use util::common::ErrorReported; use util::nodemap::DefIdMap; -use util::ppaux::{mod, Repr, UserString}; +use util::ppaux::{self, Repr, UserString}; use std::rc::Rc; use std::iter::{repeat, AdditiveIterator}; diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index 7c431b4fc0bd0..d8b410abf8449 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -12,7 +12,7 @@ use middle::def; use middle::infer; use middle::pat_util::{PatIdMap, pat_id_map, pat_is_binding, pat_is_const}; use middle::subst::{Substs}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use check::{check_expr, check_expr_has_type, check_expr_with_expectation}; use check::{check_expr_coercable_to_type, demand, FnCtxt, Expectation}; use check::{instantiate_path, structurally_resolved_type, valid_range_bounds}; diff --git a/src/librustc_typeck/check/assoc.rs b/src/librustc_typeck/check/assoc.rs index 6950850e5f3c1..26b6d4e0296cd 100644 --- a/src/librustc_typeck/check/assoc.rs +++ b/src/librustc_typeck/check/assoc.rs @@ -9,9 +9,9 @@ // except according to those terms. use middle::infer::InferCtxt; -use middle::traits::{mod, FulfillmentContext, Normalized, MiscObligation, +use middle::traits::{self, FulfillmentContext, Normalized, MiscObligation, SelectionContext, ObligationCause}; -use middle::ty::{mod, HasProjectionTypes}; +use middle::ty::{self, HasProjectionTypes}; use middle::ty_fold::{TypeFoldable, TypeFolder}; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs index eba040e7ea8b6..db84f1dce9751 100644 --- a/src/librustc_typeck/check/closure.rs +++ b/src/librustc_typeck/check/closure.rs @@ -16,7 +16,7 @@ use astconv; use middle::infer; use middle::region::CodeExtent; use middle::subst; -use middle::ty::{mod, ToPolyTraitRef, Ty}; +use middle::ty::{self, ToPolyTraitRef, Ty}; use rscope::RegionScope; use syntax::abi; use syntax::ast; diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs index 9af9eaf75f5a5..5b586bb0b669a 100644 --- a/src/librustc_typeck/check/demand.rs +++ b/src/librustc_typeck/check/demand.rs @@ -10,7 +10,7 @@ use check::FnCtxt; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::infer; use std::result::Result::{Err, Ok}; diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs index ee859bbe8f52d..54d2378256d3a 100644 --- a/src/librustc_typeck/check/method/confirm.rs +++ b/src/librustc_typeck/check/method/confirm.rs @@ -10,11 +10,11 @@ use super::probe; -use check::{mod, FnCtxt, NoPreference, PreferMutLvalue, callee, demand}; +use check::{self, FnCtxt, NoPreference, PreferMutLvalue, callee, demand}; use middle::mem_categorization::Typer; -use middle::subst::{mod}; +use middle::subst::{self}; use middle::traits; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::{MethodCall, MethodCallee, MethodObject, MethodOrigin, MethodParam, MethodStatic, MethodTraitObject, MethodTypeParam}; use middle::ty_fold::TypeFoldable; diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 92b8c2bbcf718..ad43dd84ef6b2 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 cd97d89b2465a..8adb592633f5e 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -18,7 +18,7 @@ use middle::fast_reject; use middle::subst; use middle::subst::Subst; use middle::traits; -use middle::ty::{mod, Ty, ToPolyTraitRef}; +use middle::ty::{self, Ty, ToPolyTraitRef}; use middle::ty_fold::TypeFoldable; use middle::infer; use middle::infer::InferCtxt; @@ -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 7f1feb9365a8f..e6ae5f0a447d3 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -81,20 +81,20 @@ pub use self::Expectation::*; use self::IsBinopAssignment::*; use self::TupleArgumentsFlag::*; -use astconv::{mod, ast_region_to_region, ast_ty_to_ty, AstConv}; +use astconv::{self, ast_region_to_region, ast_ty_to_ty, AstConv}; use check::_match::pat_ctxt; use middle::{const_eval, def}; use middle::infer; use middle::lang_items::IteratorItem; use middle::mem_categorization as mc; use middle::mem_categorization::McResult; -use middle::pat_util::{mod, pat_id_map}; +use middle::pat_util::{self, pat_id_map}; use middle::region::CodeExtent; -use middle::subst::{mod, Subst, Substs, VecPerParamSpace, ParamSpace}; +use middle::subst::{self, Subst, Substs, VecPerParamSpace, ParamSpace}; use middle::traits; use middle::ty::{FnSig, VariantInfo, TypeScheme}; use middle::ty::{Disr, ParamTy, ParameterEnvironment}; -use middle::ty::{mod, HasProjectionTypes, RegionEscape, Ty}; +use middle::ty::{self, HasProjectionTypes, RegionEscape, Ty}; use middle::ty::liberate_late_bound_regions; use middle::ty::{MethodCall, MethodCallee, MethodMap, ObjectCastMap}; use middle::ty_fold::{TypeFolder, TypeFoldable}; @@ -105,22 +105,22 @@ use TypeAndSubsts; use middle::lang_items::TypeIdLangItem; use lint; use util::common::{block_query, indenter, loop_query}; -use util::ppaux::{mod, UserString, Repr}; +use util::ppaux::{self, UserString, Repr}; use util::nodemap::{DefIdMap, FnvHashMap, NodeMap}; use std::cell::{Cell, Ref, RefCell}; use std::mem::replace; use std::rc::Rc; use std::iter::repeat; -use syntax::{mod, abi, attr}; -use syntax::ast::{mod, ProvidedMethod, RequiredMethod, TypeTraitItem, DefId}; -use syntax::ast_util::{mod, local_def, PostExpansionMethod}; -use syntax::codemap::{mod, Span}; +use syntax::{self, abi, attr}; +use syntax::ast::{self, ProvidedMethod, RequiredMethod, TypeTraitItem, DefId}; +use syntax::ast_util::{self, local_def, PostExpansionMethod}; +use syntax::codemap::{self, Span}; use syntax::owned_slice::OwnedSlice; use syntax::parse::token; use syntax::print::pprust; use syntax::ptr::P; -use syntax::visit::{mod, Visitor}; +use syntax::visit::{self, Visitor}; mod assoc; pub mod _match; @@ -170,7 +170,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, @@ -221,7 +221,7 @@ impl<'tcx> Expectation<'tcx> { } } -#[deriving(Copy, Clone)] +#[derive(Copy, Clone)] pub struct UnsafetyState { pub def: ast::NodeId, pub unsafety: ast::Unsafety, @@ -257,13 +257,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, @@ -2218,7 +2218,7 @@ impl<'a, 'tcx> RegionScope for FnCtxt<'a, 'tcx> { } } -#[deriving(Copy, Show, PartialEq, Eq)] +#[derive(Copy, Show, PartialEq, Eq)] pub enum LvaluePreference { PreferMutLvalue, NoPreference @@ -3058,7 +3058,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, @@ -3080,7 +3080,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/regionck.rs b/src/librustc_typeck/check/regionck.rs index 6b5f08e22ddab..b5ddb528c2f2f 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -91,7 +91,7 @@ use middle::mem_categorization as mc; use middle::region::CodeExtent; use middle::traits; use middle::ty::{ReScope}; -use middle::ty::{mod, Ty, MethodCall}; +use middle::ty::{self, Ty, MethodCall}; use middle::infer; use middle::pat_util; use util::ppaux::{ty_to_string, Repr}; diff --git a/src/librustc_typeck/check/regionmanip.rs b/src/librustc_typeck/check/regionmanip.rs index 42ffe2d5327bc..66cf077d4c21f 100644 --- a/src/librustc_typeck/check/regionmanip.rs +++ b/src/librustc_typeck/check/regionmanip.rs @@ -13,7 +13,7 @@ pub use self::WfConstraint::*; use middle::subst::{ParamSpace, Subst, Substs}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty_fold::{TypeFolder}; use syntax::ast; diff --git a/src/librustc_typeck/check/upvar.rs b/src/librustc_typeck/check/upvar.rs index a4c3550fcd676..1fdb68854c01f 100644 --- a/src/librustc_typeck/check/upvar.rs +++ b/src/librustc_typeck/check/upvar.rs @@ -44,11 +44,11 @@ use super::FnCtxt; use middle::expr_use_visitor as euv; use middle::mem_categorization as mc; -use middle::ty::{mod}; +use middle::ty::{self}; use middle::infer::{InferCtxt, UpvarRegion}; use syntax::ast; use syntax::codemap::Span; -use syntax::visit::{mod, Visitor}; +use syntax::visit::{self, Visitor}; use util::ppaux::Repr; /////////////////////////////////////////////////////////////////////////// diff --git a/src/librustc_typeck/check/vtable.rs b/src/librustc_typeck/check/vtable.rs index 8566d1f1e12b9..87ede24226bdb 100644 --- a/src/librustc_typeck/check/vtable.rs +++ b/src/librustc_typeck/check/vtable.rs @@ -9,10 +9,10 @@ // except according to those terms. use check::{FnCtxt, structurally_resolved_type}; -use middle::traits::{mod, ObjectSafetyViolation, MethodViolationCode}; +use middle::traits::{self, ObjectSafetyViolation, MethodViolationCode}; use middle::traits::{Obligation, ObligationCause}; use middle::traits::report_fulfillment_errors; -use middle::ty::{mod, Ty, AsPredicate}; +use middle::ty::{self, Ty, AsPredicate}; use middle::infer; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_typeck/check/wf.rs b/src/librustc_typeck/check/wf.rs index 410697b0aca2a..704025f38ce0d 100644 --- a/src/librustc_typeck/check/wf.rs +++ b/src/librustc_typeck/check/wf.rs @@ -14,7 +14,7 @@ use CrateCtxt; use middle::region; use middle::subst; use middle::traits; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use middle::ty::liberate_late_bound_regions; use middle::ty_fold::{TypeFolder, TypeFoldable, super_fold_ty}; use util::ppaux::Repr; diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs index 5ef9757b91ac2..4154937b3fdcd 100644 --- a/src/librustc_typeck/check/writeback.rs +++ b/src/librustc_typeck/check/writeback.rs @@ -16,7 +16,7 @@ use self::ResolveReason::*; use astconv::AstConv; use check::FnCtxt; use middle::pat_util; -use middle::ty::{mod, Ty, MethodCall, MethodCallee}; +use middle::ty::{self, Ty, MethodCall, MethodCallee}; use middle::ty_fold::{TypeFolder,TypeFoldable}; use middle::infer; use write_substs_to_tcx; @@ -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/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index bb308198330f3..45b248dac9353 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -18,7 +18,7 @@ use metadata::csearch::{each_impl, get_impl_trait}; use metadata::csearch; -use middle::subst::{mod, Subst}; +use middle::subst::{self, Subst}; use middle::ty::RegionEscape; use middle::ty::{ImplContainer, ImplOrTraitItemId, MethodTraitItemId}; use middle::ty::{ParameterEnvironment, TypeTraitItemId, lookup_item_type}; diff --git a/src/librustc_typeck/coherence/overlap.rs b/src/librustc_typeck/coherence/overlap.rs index 0e74d4578d95b..f618a79e27de7 100644 --- a/src/librustc_typeck/coherence/overlap.rs +++ b/src/librustc_typeck/coherence/overlap.rs @@ -13,7 +13,7 @@ use middle::traits; use middle::ty; -use middle::infer::{mod, new_infer_ctxt}; +use middle::infer::{self, new_infer_ctxt}; use syntax::ast::{DefId}; use syntax::ast::{LOCAL_CRATE}; use syntax::ast; diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 8c2cb557c1c9d..009f1e50e9b4b 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -29,7 +29,7 @@ bounds for each parameter. Type parameters themselves are represented as `ty_param()` instances. */ -use astconv::{mod, AstConv, ty_of_arg, ast_ty_to_ty, ast_region_to_region}; +use astconv::{self, AstConv, ty_of_arg, ast_ty_to_ty, ast_region_to_region}; use metadata::csearch; use middle::lang_items::SizedTraitLangItem; use middle::region; @@ -37,8 +37,8 @@ use middle::resolve_lifetime; use middle::subst; use middle::subst::{Substs}; use middle::ty::{AsPredicate, ImplContainer, ImplOrTraitItemContainer, TraitContainer}; -use middle::ty::{mod, RegionEscape, Ty, TypeScheme}; -use middle::ty_fold::{mod, TypeFolder, TypeFoldable}; +use middle::ty::{self, RegionEscape, Ty, TypeScheme}; +use middle::ty_fold::{self, TypeFolder, TypeFoldable}; use middle::infer; use rscope::*; use {CrateCtxt, no_params, write_ty_to_tcx}; diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index cc5b1f635e370..48f9b12971971 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -93,7 +93,7 @@ use middle::def; use middle::infer; use middle::subst; use middle::subst::VecPerParamSpace; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use session::config; use util::common::time; use util::ppaux::Repr; 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..6bef7e713af28 100644 --- a/src/librustc_typeck/variance.rs +++ b/src/librustc_typeck/variance.rs @@ -196,7 +196,7 @@ use arena::Arena; use middle::resolve_lifetime as rl; use middle::subst; use middle::subst::{ParamSpace, FnSpace, TypeSpace, SelfSpace, VecPerParamSpace}; -use middle::ty::{mod, Ty}; +use middle::ty::{self, Ty}; use std::fmt; use std::rc::Rc; use std::iter::repeat; @@ -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..3f5b0eaee124f 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -34,7 +34,7 @@ use syntax::ast_util::PostExpansionMethod; use syntax::attr; use syntax::attr::{AttributeMethods, AttrMetaMethods}; use syntax::codemap::{DUMMY_SP, Pos, Spanned}; -use syntax::parse::token::{mod, InternedString, special_idents}; +use syntax::parse::token::{self, InternedString, special_idents}; use syntax::ptr::P; use rustc_trans::back::link; @@ -42,7 +42,7 @@ use rustc::metadata::cstore; use rustc::metadata::csearch; use rustc::metadata::decoder; use rustc::middle::def; -use rustc::middle::subst::{mod, ParamSpace, VecPerParamSpace}; +use rustc::middle::subst::{self, ParamSpace, VecPerParamSpace}; use rustc::middle::ty; use rustc::middle::stability; use rustc::session::config; @@ -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/core.rs b/src/librustdoc/core.rs index 2416eb2869ee2..a69437f7a669c 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -10,7 +10,7 @@ pub use self::MaybeTyped::*; use rustc_driver::driver; -use rustc::session::{mod, config}; +use rustc::session::{self, config}; use rustc::session::search_paths::SearchPaths; use rustc::middle::{privacy, ty}; use rustc::lint; 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 36619566f8c8a..9004d11b5bccf 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 1fce5d5969819..9d003eca27f3d 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -373,7 +373,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 0cfc1042ae605..338b9b3e0eba4 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -35,7 +35,7 @@ pub use self::ExternalLocation::*; use std::cell::RefCell; -use std::cmp::Ordering::{mod, Less, Greater, Equal}; +use std::cmp::Ordering::{self, Less, Greater, Equal}; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::{HashMap, HashSet}; use std::default::Default; @@ -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/lib.rs b/src/librustdoc/lib.rs index f0feb8de1cefa..125bc21d79d06 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -44,7 +44,7 @@ use std::io; use std::rc::Rc; use externalfiles::ExternalHtml; use serialize::Decodable; -use serialize::json::{mod, Json}; +use serialize::json::{self, Json}; use rustc::session::search_paths::SearchPaths; // reexported from `clean` so it can be easily updated with the mod itself diff --git a/src/librustdoc/stability_summary.rs b/src/librustdoc/stability_summary.rs index 0d6d7a47c8579..690a5d19367ed 100644 --- a/src/librustdoc/stability_summary.rs +++ b/src/librustdoc/stability_summary.rs @@ -26,9 +26,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, @@ -76,7 +76,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/librustdoc/test.rs b/src/librustdoc/test.rs index 743c8b240d125..bded371e5002d 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -20,7 +20,7 @@ use std::thunk::Thunk; use std::collections::{HashSet, HashMap}; use testing; -use rustc::session::{mod, config}; +use rustc::session::{self, config}; use rustc::session::search_paths::{SearchPaths, PathKind}; use rustc_driver::driver; use syntax::ast; 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 71117c7fe128f..73f986a97ef49 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. @@ -82,7 +82,7 @@ //! use serialize::json; //! //! // Automatically generate `Decodable` and `Encodable` trait implementations -//! #[deriving(RustcDecodable, RustcEncodable)] +//! #[derive(RustcDecodable, RustcEncodable)] //! pub struct TestStruct { //! data_int: u8, //! data_str: String, @@ -114,7 +114,7 @@ //! ```notrust //! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment //! extern crate serialize; -//! use serialize::json::{mod, ToJson, Json}; +//! use serialize::json::{self, ToJson, Json}; //! //! // A custom data structure //! struct ComplexNum { @@ -130,7 +130,7 @@ //! } //! //! // Only generate `RustcEncodable` trait implementation -//! #[deriving(Encodable)] +//! #[derive(Encodable)] //! pub struct ComplexNumRecord { //! uid: u8, //! dsc: String, @@ -155,10 +155,10 @@ //! // FIXME(#19470): this cannot be ```rust``` because it fails orphan checking at the moment //! extern crate serialize; //! use std::collections::BTreeMap; -//! use serialize::json::{mod, Json, ToJson}; +//! use serialize::json::{self, Json, ToJson}; //! //! // Only generate `Decodable` trait implementation -//! #[deriving(Decodable)] +//! #[derive(Decodable)] //! pub struct TestStruct { //! data_int: u8, //! data_str: String, @@ -215,7 +215,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), @@ -236,7 +236,7 @@ pub struct AsJson<'a, T: 'a> { inner: &'a T } pub struct AsPrettyJson<'a, T: 'a> { inner: &'a T, indent: Option } /// The errors that can arise while parsing a JSON stream. -#[deriving(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub enum ErrorCode { InvalidSyntax, InvalidNumber, @@ -257,7 +257,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), @@ -267,7 +267,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), @@ -1164,7 +1164,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, @@ -1179,7 +1179,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), @@ -1208,7 +1208,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), @@ -1216,7 +1216,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 @@ -2534,7 +2534,7 @@ mod tests { use std::num::Float; use std::string; - #[deriving(RustcDecodable, Eq, PartialEq, Show)] + #[derive(RustcDecodable, Eq, PartialEq, Show)] struct OptionData { opt: Option, } @@ -2561,20 +2561,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, } @@ -3093,7 +3093,7 @@ mod tests { ); } - #[deriving(RustcDecodable)] + #[derive(RustcDecodable)] struct FloatStruct { f: f64, a: Vec @@ -3142,7 +3142,7 @@ mod tests { Err(SyntaxError(EOFWhileParsingObject, 3u, 8u))); } - #[deriving(RustcDecodable)] + #[derive(RustcDecodable)] #[allow(dead_code)] struct DecodeStruct { x: f64, @@ -3150,7 +3150,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 16bc6b16598e0..65cbce08543cc 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 834a9f082d03a..4fb4f220c592a 100644 --- a/src/libstd/c_str.rs +++ b/src/libstd/c_str.rs @@ -77,7 +77,7 @@ use fmt; use hash; use mem; use ptr; -use slice::{mod, IntSliceExt}; +use slice::{self, IntSliceExt}; use str; use string::String; use core::kinds::marker; @@ -498,7 +498,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 f246e9df3b987..c63484396d211 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -18,11 +18,11 @@ use borrow::BorrowFrom; use clone::Clone; use cmp::{max, Eq, Equiv, PartialEq}; use default::Default; -use fmt::{mod, Show}; +use fmt::{self, Show}; use hash::{Hash, Hasher, RandomSipHasher}; -use iter::{mod, Iterator, IteratorExt, FromIterator, Extend, Map}; +use iter::{self, Iterator, IteratorExt, FromIterator, Extend, Map}; use kinds::Sized; -use mem::{mod, replace}; +use mem::{self, replace}; use num::{Int, UnsignedInt}; use ops::{Deref, FnMut, Index, IndexMut}; use option::Option; @@ -31,7 +31,7 @@ use result::Result; use result::Result::{Ok, Err}; use super::table::{ - mod, + self, Bucket, EmptyBucket, FullBucket, @@ -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. @@ -1356,7 +1356,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 { @@ -1388,7 +1388,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 { @@ -1403,7 +1403,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 { @@ -1622,7 +1622,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 4c6a74a78d510..28c78ca3a9137 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -20,10 +20,10 @@ use fmt; use hash::{Hash, Hasher, RandomSipHasher}; use iter::{Iterator, IteratorExt, IteratorCloneExt, FromIterator, Map, Chain, Extend}; use ops::{BitOr, BitAnd, BitXor, Sub}; -use option::Option::{Some, None, mod}; +use option::Option::{Some, None, self}; use result::Result::{Ok, Err}; -use super::map::{mod, HashMap, Keys, INITIAL_CAPACITY}; +use super::map::{self, HashMap, Keys, INITIAL_CAPACITY}; // Future Optimization (FIXME!) // ============================= @@ -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 2b999d83a98c2..7c87094805dee 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 { @@ -791,7 +791,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/dynamic_lib.rs b/src/libstd/dynamic_lib.rs index ecfe2d15ae1c2..de3d75ffb3242 100644 --- a/src/libstd/dynamic_lib.rs +++ b/src/libstd/dynamic_lib.rs @@ -252,7 +252,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 852cab500f673..d97f4a7bc34b6 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -413,7 +413,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 1ff54fcb48432..5cb79d41db940 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 ad921e43c0cc5..1615541e37d41 100644 --- a/src/libstd/io/mem.rs +++ b/src/libstd/io/mem.rs @@ -19,7 +19,7 @@ use option::Option::None; use result::Result::{Err, Ok}; use io; use io::{Reader, Writer, Seek, Buffer, IoError, SeekStyle, IoResult}; -use slice::{mod, AsSlice, SliceExt}; +use slice::{self, AsSlice, SliceExt}; use vec::Vec; const BUF_CAPACITY: uint = 128; @@ -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 917ffa4ff76da..590231dcd827c 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -301,7 +301,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. @@ -368,7 +368,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, @@ -1565,7 +1565,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, @@ -1690,7 +1690,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, @@ -1702,7 +1702,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, @@ -1713,7 +1713,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, @@ -1751,7 +1751,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, @@ -1790,7 +1790,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, @@ -1929,7 +1929,7 @@ mod tests { use prelude::v1::{Ok, Vec, Buffer, SliceExt}; 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 d86cb841f96ce..24d45dcd65275 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 eeb858a18870b..52b589b5f24a7 100644 --- a/src/libstd/io/net/ip.rs +++ b/src/libstd/io/net/ip.rs @@ -18,7 +18,7 @@ pub use self::IpAddr::*; use fmt; -use io::{mod, IoResult, IoError}; +use io::{self, IoResult, IoError}; use io::net; use iter::{Iterator, IteratorExt}; use ops::FnOnce; @@ -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 fedc102e45d53..5886c9cc3e287 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 cd991c5f884f5..f571bed3ba226 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 51d1bacf63b9f..1381ad17ea2aa 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 007d89a942dcc..8f21fb0b8b97d 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -727,7 +727,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 6c64251091a31..20dd70f0faab2 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -16,8 +16,8 @@ use self::ExponentFormat::*; use self::SignificantDigits::*; use self::SignFormat::*; -use char::{mod, Char}; -use num::{mod, Int, Float, ToPrimitive}; +use char::{self, Char}; +use num::{self, Int, Float, ToPrimitive}; use num::FpCategory as Fp; use ops::FnMut; use slice::SliceExt; @@ -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 2ca6bccabc018..771c808ab8a7a 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -361,7 +361,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. @@ -862,7 +862,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 39b96ef6aeea0..ae82e201cb855 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -35,7 +35,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 @@ -450,10 +450,10 @@ mod tests { use clone::Clone; use iter::IteratorExt; - use option::Option::{mod, Some, None}; + use option::Option::{self, Some, None}; use path::GenericPath; use slice::{AsSlice, SliceExt}; - use str::{mod, Str, StrExt}; + use str::{self, Str, StrExt}; use string::ToString; use vec::Vec; diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index f6fb149e82cf6..aae8d6cadefb2 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), @@ -1125,7 +1125,7 @@ mod tests { use clone::Clone; use iter::IteratorExt; - use option::Option::{mod, Some, None}; + use option::Option::{self, Some, None}; use path::GenericPath; use slice::{AsSlice, SliceExt}; use str::Str; diff --git a/src/libstd/prelude/v1.rs b/src/libstd/prelude/v1.rs index 2d2f3f895d0c1..a122cb81b8c42 100644 --- a/src/libstd/prelude/v1.rs +++ b/src/libstd/prelude/v1.rs @@ -30,9 +30,9 @@ #[stable] #[doc(no_inline)] pub use iter::ExactSizeIterator; #[stable] #[doc(no_inline)] pub use iter::{Iterator, IteratorExt, Extend}; #[stable] #[doc(no_inline)] pub use iter::{IteratorCloneExt, IteratorOrdExt}; -#[stable] #[doc(no_inline)] pub use option::Option::{mod, Some, None}; +#[stable] #[doc(no_inline)] pub use option::Option::{self, Some, None}; #[stable] #[doc(no_inline)] pub use ptr::{PtrExt, MutPtrExt}; -#[stable] #[doc(no_inline)] pub use result::Result::{mod, Ok, Err}; +#[stable] #[doc(no_inline)] pub use result::Result::{self, Ok, Err}; #[stable] #[doc(no_inline)] pub use slice::AsSlice; #[stable] #[doc(no_inline)] pub use slice::{SliceExt, SliceConcatExt}; #[stable] #[doc(no_inline)] pub use str::{Str, StrExt}; diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 208e4f9e566f4..55063f1393f74 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 3fdfb5327ee1f..7cc39d7d97248 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/mod.rs b/src/libstd/rt/mod.rs index 68aaa1b3ae55d..2b0639c570537 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -66,7 +66,7 @@ fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int { use mem; use os; use rt; - use sys_common::thread_info::{mod, NewThread}; + use sys_common::thread_info::{self, NewThread}; use sys_common; use thread::Thread; diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index 6f6be2e111df4..99f791df474f4 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/rt/util.rs b/src/libstd/rt/util.rs index 09859cab53620..d6cf35ee3cd90 100644 --- a/src/libstd/rt/util.rs +++ b/src/libstd/rt/util.rs @@ -15,7 +15,7 @@ use prelude::v1::*; use cmp; use fmt; use intrinsics; -use libc::{mod, uintptr_t}; +use libc::{self, uintptr_t}; use os; use slice; use str; diff --git a/src/libstd/sync/atomic.rs b/src/libstd/sync/atomic.rs index d4d7607bde34c..3652b45ce973b 100644 --- a/src/libstd/sync/atomic.rs +++ b/src/libstd/sync/atomic.rs @@ -104,7 +104,7 @@ pub use core::atomic::{AtomicBool, AtomicInt, AtomicUint, AtomicPtr}; pub use core::atomic::{INIT_ATOMIC_BOOL, INIT_ATOMIC_INT, INIT_ATOMIC_UINT}; pub use core::atomic::{ATOMIC_BOOL_INIT, ATOMIC_INT_INIT, ATOMIC_UINT_INIT}; pub use core::atomic::fence; -pub use core::atomic::Ordering::{mod, Relaxed, Release, Acquire, AcqRel, SeqCst}; +pub use core::atomic::Ordering::{self, Relaxed, Release, Acquire, AcqRel, SeqCst}; /// An atomic, nullable unique pointer /// diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 19b8f5e62cf55..28c36922ca6f8 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -10,8 +10,8 @@ use prelude::v1::*; -use sync::atomic::{mod, AtomicUint}; -use sync::poison::{mod, LockResult}; +use sync::atomic::{self, AtomicUint}; +use sync::poison::{self, LockResult}; use sys_common::condvar as sys; use sys_common::mutex as sys_mutex; use time::Duration; diff --git a/src/libstd/sync/mpsc/blocking.rs b/src/libstd/sync/mpsc/blocking.rs index a529901272358..faff5f09f81e1 100644 --- a/src/libstd/sync/mpsc/blocking.rs +++ b/src/libstd/sync/mpsc/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/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index e9dc3d986ba11..de1724cbc4e89 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -379,7 +379,7 @@ pub struct SyncSender { /// A `send` operation can only fail if the receiving end of a channel is /// disconnected, implying that the data could never be received. The error /// contains the data being sent as a payload so it can be recovered. -#[deriving(PartialEq, Eq)] +#[derive(PartialEq, Eq)] #[stable] pub struct SendError(pub T); @@ -387,13 +387,13 @@ pub struct SendError(pub T); /// /// The `recv` operation can only fail if the sending half of a channel is /// disconnected, implying that no further messages will ever be received. -#[deriving(PartialEq, Eq, Clone, Copy)] +#[derive(PartialEq, Eq, Clone, Copy)] #[stable] pub struct RecvError; /// This enumeration is the list of the possible reasons that try_recv could not /// return data when called. -#[deriving(PartialEq, Clone, Copy)] +#[derive(PartialEq, Clone, Copy)] #[stable] pub enum TryRecvError { /// This channel is currently empty, but the sender(s) have not yet @@ -409,7 +409,7 @@ pub enum TryRecvError { /// This enumeration is the list of the possible error outcomes for the /// `SyncSender::try_send` method. -#[deriving(PartialEq, Clone)] +#[derive(PartialEq, Clone)] #[stable] pub enum TrySendError { /// The data could not be sent on the channel because it would require that diff --git a/src/libstd/sync/mpsc/oneshot.rs b/src/libstd/sync/mpsc/oneshot.rs index 5f599752a46fc..2811f403c6c3d 100644 --- a/src/libstd/sync/mpsc/oneshot.rs +++ b/src/libstd/sync/mpsc/oneshot.rs @@ -40,7 +40,7 @@ use self::MyUpgrade::*; use core::prelude::*; use sync::mpsc::Receiver; -use sync::mpsc::blocking::{mod, SignalToken}; +use sync::mpsc::blocking::{self, SignalToken}; use core::mem; use sync::atomic; diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index 3d9dca7e21cb3..16adbf5aa4f69 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -62,7 +62,7 @@ use core::mem; use core::uint; use sync::mpsc::{Receiver, RecvError}; -use sync::mpsc::blocking::{mod, SignalToken}; +use sync::mpsc::blocking::{self, SignalToken}; /// The "receiver set" of the select interface. This structure is used to manage /// a set of receivers which are being selected over. @@ -94,7 +94,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/sync/mpsc/shared.rs b/src/libstd/sync/mpsc/shared.rs index e15c38cf9a1b3..cadac8e62724e 100644 --- a/src/libstd/sync/mpsc/shared.rs +++ b/src/libstd/sync/mpsc/shared.rs @@ -27,7 +27,7 @@ use core::int; use sync::{atomic, Mutex, MutexGuard}; use sync::mpsc::mpsc_queue as mpsc; -use sync::mpsc::blocking::{mod, SignalToken}; +use sync::mpsc::blocking::{self, SignalToken}; use sync::mpsc::select::StartResult; use sync::mpsc::select::StartResult::*; use thread::Thread; diff --git a/src/libstd/sync/mpsc/stream.rs b/src/libstd/sync/mpsc/stream.rs index 01b799283ee3b..c526e6acb8f15 100644 --- a/src/libstd/sync/mpsc/stream.rs +++ b/src/libstd/sync/mpsc/stream.rs @@ -28,7 +28,7 @@ use core::cmp; use core::int; use thread::Thread; -use sync::mpsc::blocking::{mod, SignalToken}; +use sync::mpsc::blocking::{self, SignalToken}; use sync::mpsc::spsc_queue as spsc; use sync::mpsc::Receiver; use sync::atomic; diff --git a/src/libstd/sync/mpsc/sync.rs b/src/libstd/sync/mpsc/sync.rs index 98f1c4c46f9fb..0eee10898bcbb 100644 --- a/src/libstd/sync/mpsc/sync.rs +++ b/src/libstd/sync/mpsc/sync.rs @@ -42,8 +42,8 @@ use vec::Vec; use core::mem; use sync::{atomic, Mutex, MutexGuard}; -use sync::mpsc::blocking::{mod, WaitToken, SignalToken}; -use sync::mpsc::select::StartResult::{mod, Installed, Abort}; +use sync::mpsc::blocking::{self, WaitToken, SignalToken}; +use sync::mpsc::select::StartResult::{self, Installed, Abort}; pub struct Packet { /// Only field outside of the mutex. Just done for kicks, but mainly because @@ -103,7 +103,7 @@ struct Buffer { size: uint, } -#[deriving(Show)] +#[derive(Show)] pub enum Failure { Empty, Disconnected, diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index f9f9a80922171..b158bd69c7b50 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -13,7 +13,7 @@ use prelude::v1::*; use cell::UnsafeCell; use kinds::marker; use ops::{Deref, DerefMut}; -use sync::poison::{mod, TryLockError, TryLockResult, LockResult}; +use sync::poison::{self, TryLockError, TryLockResult, LockResult}; use sys_common::mutex as sys; /// A mutual exclusion primitive useful for protecting shared data diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 431aeb9cae9f8..b2367ff8352fb 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -13,7 +13,7 @@ use prelude::v1::*; use cell::UnsafeCell; use kinds::marker; use ops::{Deref, DerefMut}; -use sync::poison::{mod, LockResult, TryLockError, TryLockResult}; +use sync::poison::{self, LockResult, TryLockError, TryLockResult}; use sys_common::rwlock as sys; /// A reader-writer lock @@ -362,7 +362,7 @@ impl<'a, T> Drop for RWLockWriteGuard<'a, T> { mod tests { use prelude::v1::*; - use rand::{mod, Rng}; + use rand::{self, Rng}; use sync::mpsc::channel; use thread::Thread; use sync::{Arc, RWLock, StaticRWLock, RWLOCK_INIT}; diff --git a/src/libstd/sys/common/condvar.rs b/src/libstd/sys/common/condvar.rs index e09d970402966..32fa6ec590335 100644 --- a/src/libstd/sys/common/condvar.rs +++ b/src/libstd/sys/common/condvar.rs @@ -9,7 +9,7 @@ // except according to those terms. use time::Duration; -use sys_common::mutex::{mod, Mutex}; +use sys_common::mutex::{self, Mutex}; use sys::condvar as imp; /// An OS-based condition variable. diff --git a/src/libstd/sys/common/mod.rs b/src/libstd/sys/common/mod.rs index 97015f74a4a10..a441e55a732b0 100644 --- a/src/libstd/sys/common/mod.rs +++ b/src/libstd/sys/common/mod.rs @@ -11,7 +11,7 @@ #![allow(missing_docs)] #![allow(dead_code)] -use io::{mod, IoError, IoResult}; +use io::{self, IoError, IoResult}; use prelude::v1::*; use sys::{last_error, retry}; use c_str::CString; diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 94a2c9b78faef..3f67b284f6887 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -16,22 +16,22 @@ use c_str::ToCStr; use io::net::addrinfo; use io::net::ip::{SocketAddr, IpAddr, Ipv4Addr, Ipv6Addr}; use io::{IoResult, IoError}; -use libc::{mod, c_char, c_int}; +use libc::{self, c_char, c_int}; use c_str::CString; use mem; use num::Int; -use ptr::{mod, null, null_mut}; -use sys::{mod, retry, c, sock_t, last_error, last_net_error, last_gai_error, close_sock, +use ptr::{self, null, null_mut}; +use sys::{self, retry, c, sock_t, last_error, last_net_error, last_gai_error, close_sock, wrlen, msglen_t, os, wouldblock, set_nonblocking, timer, ms_to_timeval, decode_error_detailed}; use sync::{Arc, Mutex, MutexGuard}; -use sys_common::{mod, keep_going, short_write, timeout}; +use sys_common::{self, keep_going, short_write, timeout}; use cmp; 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/sys/common/thread_local.rs b/src/libstd/sys/common/thread_local.rs index 9d7188a37bcdf..158fd3a8382a2 100644 --- a/src/libstd/sys/common/thread_local.rs +++ b/src/libstd/sys/common/thread_local.rs @@ -58,7 +58,7 @@ use prelude::v1::*; -use sync::atomic::{mod, AtomicUint}; +use sync::atomic::{self, AtomicUint}; use sync::{Mutex, Once, ONCE_INIT}; use sys::thread_local as imp; diff --git a/src/libstd/sys/unix/backtrace.rs b/src/libstd/sys/unix/backtrace.rs index 9e26475f814b7..5b261ea6b9e58 100644 --- a/src/libstd/sys/unix/backtrace.rs +++ b/src/libstd/sys/unix/backtrace.rs @@ -87,7 +87,7 @@ use c_str::CString; use io::{IoResult, Writer}; use libc; use mem; -use option::Option::{mod, Some, None}; +use option::Option::{self, Some, None}; use result::Result::{Ok, Err}; use sync::{StaticMutex, MUTEX_INIT}; diff --git a/src/libstd/sys/unix/condvar.rs b/src/libstd/sys/unix/condvar.rs index f64718539ef0c..3aa4825f3be99 100644 --- a/src/libstd/sys/unix/condvar.rs +++ b/src/libstd/sys/unix/condvar.rs @@ -10,7 +10,7 @@ use cell::UnsafeCell; use libc; -use sys::mutex::{mod, Mutex}; +use sys::mutex::{self, Mutex}; use sys::sync as ffi; use time::Duration; diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index e3e0b279c12c7..b49ace8e2f8d8 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -17,7 +17,7 @@ use io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode}; use io::{IoResult, FileStat, SeekStyle}; use io::{Read, Truncate, SeekCur, SeekSet, ReadWrite, SeekEnd, Append}; use io; -use libc::{mod, c_int, c_void}; +use libc::{self, c_int, c_void}; use mem; use sys::retry; use sys_common::{keep_going, eof, mkerr_libc}; diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs index 4199cbc1bb9f5..ea0d230e8b210 100644 --- a/src/libstd/sys/unix/mod.rs +++ b/src/libstd/sys/unix/mod.rs @@ -20,7 +20,7 @@ extern crate libc; use num; use num::{Int, SignedInt}; use prelude::v1::*; -use io::{mod, IoResult, IoError}; +use io::{self, IoResult, IoError}; use sys_common::mkerr_libc; macro_rules! helper_init { (static $name:ident: Helper<$m:ty>) => ( diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index 6a8f55e79c872..690574301d7dc 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -16,7 +16,7 @@ use c_str::ToCStr; use error::{FromError, Error}; use fmt; use io::{IoError, IoResult}; -use libc::{mod, c_int, c_char, c_void}; +use libc::{self, c_int, c_char, c_void}; use os; use path::{BytesContainer}; use ptr; diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs index 623f3f6a89c9d..fcbfb383d3cc8 100644 --- a/src/libstd/sys/unix/pipe.rs +++ b/src/libstd/sys/unix/pipe.rs @@ -14,9 +14,9 @@ use libc; use c_str::CString; use mem; use sync::{atomic, Arc, Mutex}; -use io::{mod, IoResult, IoError}; +use io::{self, IoResult, IoError}; -use sys::{mod, timer, retry, c, set_nonblocking, wouldblock}; +use sys::{self, timer, retry, c, set_nonblocking, wouldblock}; use sys::fs::{fd_t, FileDesc}; use sys_common::net::*; use sys_common::net::SocketStatus::*; diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index af09bf4fbd0a2..b73919fe2a2cc 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -15,15 +15,15 @@ use c_str::{CString, ToCStr}; use collections; use hash::Hash; use io::process::{ProcessExit, ExitStatus, ExitSignal}; -use io::{mod, IoResult, IoError, EndOfFile}; -use libc::{mod, pid_t, c_void, c_int}; +use io::{self, IoResult, IoError, EndOfFile}; +use libc::{self, pid_t, c_void, c_int}; use mem; use os; use path::BytesContainer; use ptr; use sync::mpsc::{channel, Sender, Receiver}; use sys::fs::FileDesc; -use sys::{mod, retry, c, wouldblock, set_nonblocking, ms_to_timeval}; +use sys::{self, retry, c, wouldblock, set_nonblocking, ms_to_timeval}; use sys_common::helper_thread::Helper; use sys_common::{AsInner, mkerr_libc, timeout}; diff --git a/src/libstd/sys/unix/tty.rs b/src/libstd/sys/unix/tty.rs index 4ef687d41d8ee..bee3d440a16c2 100644 --- a/src/libstd/sys/unix/tty.rs +++ b/src/libstd/sys/unix/tty.rs @@ -11,8 +11,8 @@ use prelude::v1::*; use sys::fs::FileDesc; -use libc::{mod, c_int}; -use io::{mod, IoResult, IoError}; +use libc::{self, c_int}; +use io::{self, IoResult, IoError}; use sys_common; pub struct TTY { diff --git a/src/libstd/sys/windows/condvar.rs b/src/libstd/sys/windows/condvar.rs index 7f9d669c44748..291a8024cfcce 100644 --- a/src/libstd/sys/windows/condvar.rs +++ b/src/libstd/sys/windows/condvar.rs @@ -9,9 +9,9 @@ // except according to those terms. use cell::UnsafeCell; -use libc::{mod, DWORD}; +use libc::{self, DWORD}; use os; -use sys::mutex::{mod, Mutex}; +use sys::mutex::{self, Mutex}; use sys::sync as ffi; use time::Duration; diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index 523d60c71aa8b..9a94230065680 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -11,7 +11,7 @@ //! Blocking Windows-based file I/O use alloc::arc::Arc; -use libc::{mod, c_int}; +use libc::{self, c_int}; use c_str::CString; use mem; diff --git a/src/libstd/sys/windows/helper_signal.rs b/src/libstd/sys/windows/helper_signal.rs index c547c79e83a13..a9fb2c6822767 100644 --- a/src/libstd/sys/windows/helper_signal.rs +++ b/src/libstd/sys/windows/helper_signal.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use libc::{mod, BOOL, LPCSTR, HANDLE, LPSECURITY_ATTRIBUTES, CloseHandle}; +use libc::{self, BOOL, LPCSTR, HANDLE, LPSECURITY_ATTRIBUTES, CloseHandle}; use ptr; pub type signal = HANDLE; diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs index 1034f0615d994..0e706c3cc6a57 100644 --- a/src/libstd/sys/windows/mod.rs +++ b/src/libstd/sys/windows/mod.rs @@ -22,7 +22,7 @@ use prelude::v1::*; use num; use mem; -use io::{mod, IoResult, IoError}; +use io::{self, IoResult, IoError}; use sync::{Once, ONCE_INIT}; macro_rules! helper_init { (static $name:ident: Helper<$m:ty>) => ( diff --git a/src/libstd/sys/windows/mutex.rs b/src/libstd/sys/windows/mutex.rs index e0fa02b559958..f561e0121b3e6 100644 --- a/src/libstd/sys/windows/mutex.rs +++ b/src/libstd/sys/windows/mutex.rs @@ -11,7 +11,7 @@ use prelude::v1::*; use sync::atomic; -use alloc::{mod, heap}; +use alloc::{self, heap}; use libc::DWORD; use sys::sync as ffi; diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs index f173d5fc6d4cb..0edae75a9ce64 100644 --- a/src/libstd/sys/windows/pipe.rs +++ b/src/libstd/sys/windows/pipe.rs @@ -91,9 +91,9 @@ use c_str::CString; use mem; use ptr; use sync::{atomic, Arc, Mutex}; -use io::{mod, IoError, IoResult}; +use io::{self, IoError, IoResult}; -use sys_common::{mod, eof}; +use sys_common::{self, eof}; use super::{c, os, timer, to_utf16, decode_error_detailed}; diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index cb99a886ce4fc..81e8f974a1223 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -24,7 +24,7 @@ use hash::Hash; use io::{IoResult, IoError}; use sys::fs; -use sys::{mod, retry, c, wouldblock, set_nonblocking, ms_to_timeval, timer}; +use sys::{self, retry, c, wouldblock, set_nonblocking, ms_to_timeval, timer}; use sys::fs::FileDesc; use sys_common::helper_thread::Helper; use sys_common::{AsInner, mkerr_libc, timeout}; diff --git a/src/libstd/sys/windows/tcp.rs b/src/libstd/sys/windows/tcp.rs index 5a929f6b2b5ff..1c8ec2a80a7e4 100644 --- a/src/libstd/sys/windows/tcp.rs +++ b/src/libstd/sys/windows/tcp.rs @@ -17,8 +17,8 @@ use prelude::v1::*; use super::{last_error, last_net_error, retry, sock_t}; use sync::{Arc, atomic}; use sys::fs::FileDesc; -use sys::{mod, c, set_nonblocking, wouldblock, timer}; -use sys_common::{mod, timeout, eof, net}; +use sys::{self, c, set_nonblocking, wouldblock, timer}; +use sys_common::{self, timeout, eof, net}; pub use sys_common::net::TcpStream; diff --git a/src/libstd/sys/windows/tty.rs b/src/libstd/sys/windows/tty.rs index 7591025d76d6f..4305f7743b564 100644 --- a/src/libstd/sys/windows/tty.rs +++ b/src/libstd/sys/windows/tty.rs @@ -27,7 +27,7 @@ use prelude::v1::*; -use io::{mod, IoError, IoResult, MemReader}; +use io::{self, IoError, IoResult, MemReader}; use iter::repeat; use libc::types::os::arch::extra::LPCVOID; use libc::{c_int, HANDLE, LPDWORD, DWORD, LPVOID}; diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index 3c87309dabcf3..9c8a5fc239ce3 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -131,12 +131,12 @@ use cell::UnsafeCell; use clone::Clone; use kinds::{Send, Sync}; use ops::{Drop, FnOnce}; -use option::Option::{mod, Some, None}; +use option::Option::{self, Some, None}; use result::Result::{Err, Ok}; use sync::{Mutex, Condvar, Arc}; use str::Str; use string::String; -use rt::{mod, unwind}; +use rt::{self, unwind}; use io::{Writer, stdio}; use thunk::Thunk; @@ -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/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index 91d8aec01cf34..d3b4fab96810b 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -219,7 +219,7 @@ macro_rules! __thread_local_inner { /// Indicator of the state of a thread local storage key. #[unstable = "state querying was recently added"] -#[deriving(Eq, PartialEq, Copy)] +#[derive(Eq, PartialEq, Copy)] pub enum State { /// All keys are in this state whenever a thread starts. Keys will /// transition to the `Valid` state once the first call to `with` happens diff --git a/src/libstd/time/duration.rs b/src/libstd/time/duration.rs index 41a130492c047..d48b0342b3bf7 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 a705872b53d93..01f66f3bbd060 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 pat: P, pub ty: Option>, @@ -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 b1799fc2718ff..c5dbd194e3e5f 100644 --- a/src/libsyntax/ast_map/mod.rs +++ b/src/libsyntax/ast_map/mod.rs @@ -20,19 +20,19 @@ use fold::Folder; use parse::token; use print::pprust; use ptr::P; -use visit::{mod, Visitor}; +use visit::{self, Visitor}; use arena::TypedArena; use std::cell::RefCell; use std::fmt; use std::io::IoResult; -use std::iter::{mod, repeat}; +use std::iter::{self, repeat}; use std::mem; 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>, @@ -76,7 +76,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> { @@ -104,7 +104,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), @@ -126,7 +126,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, @@ -157,7 +157,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 92818f0634160..43e23f26e930e 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 eb011faa55dc8..2c7bbcb6faf72 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -36,13 +36,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 @@ -94,7 +94,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, @@ -105,7 +105,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, @@ -188,15 +188,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. @@ -210,7 +210,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!();` @@ -231,7 +231,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); @@ -255,7 +255,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 e56194c95cd5b..91cc8a2462205 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/eq.rs b/src/libsyntax/ext/deriving/cmp/eq.rs index c8bf5ec326cd9..7a67fab820de5 100644 --- a/src/libsyntax/ext/deriving/cmp/eq.rs +++ b/src/libsyntax/ext/deriving/cmp/eq.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use ast::{MetaItem, Item, Expr, mod}; +use ast::{MetaItem, Item, Expr, self}; use codemap::Span; use ext::base::ExtCtxt; use ext::build::AstBuilder; 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..8863de8757bf7 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -196,7 +196,7 @@ use attr; use attr::AttrMetaMethods; use ext::base::ExtCtxt; use ext::build::AstBuilder; -use codemap::{mod, DUMMY_SP}; +use codemap::{self, DUMMY_SP}; use codemap::Span; use fold::MoveMap; use owned_slice::OwnedSlice; @@ -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 dcf25a26e2c69..e65ecc19ea1bb 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 8af5e952e9a11..86e81ede8b0fe 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 545856a27af4c..f75873ac1c0f7 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -107,7 +107,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 38c26e8967140..b87e2c6abbc0c 100644 --- a/src/libsyntax/owned_slice.rs +++ b/src/libsyntax/owned_slice.rs @@ -17,7 +17,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 0f5ff33021cc9..46a124074c7a3 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -51,7 +51,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 e2f86f8fd3901..c0444363d4ec4 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -65,8 +65,8 @@ use ast::{ViewItem, ViewItem_, ViewItemExternCrate, ViewItemUse}; use ast::{ViewPath, ViewPathGlob, ViewPathList, ViewPathSimple}; use ast::{Visibility, WhereClause}; use ast; -use ast_util::{mod, as_prec, ident_to_path, operator_prec}; -use codemap::{mod, Span, BytePos, Spanned, spanned, mk_sp, DUMMY_SP}; +use ast_util::{self, as_prec, ident_to_path, operator_prec}; +use codemap::{self, Span, BytePos, Spanned, spanned, mk_sp, DUMMY_SP}; use diagnostic; use ext::tt::macro_parser; use parse; @@ -75,7 +75,7 @@ use parse::classify; use parse::common::{SeqSep, seq_sep_none, seq_sep_trailing_allowed}; use parse::lexer::{Reader, TokenAndSpan}; use parse::obsolete::*; -use parse::token::{mod, MatchNt, SubstNt, InternedString}; +use parse::token::{self, MatchNt, SubstNt, InternedString}; use parse::token::{keywords, special_idents}; use parse::{new_sub_parser_from_file, ParseSess}; use print::pprust; @@ -106,7 +106,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, @@ -119,7 +119,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, @@ -318,7 +318,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 2745b7e13e9bb..1df7e2893f68a 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -30,7 +30,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, @@ -45,7 +45,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, @@ -55,14 +55,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), @@ -88,7 +88,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, @@ -336,7 +336,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), @@ -432,7 +432,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, )* @@ -582,7 +582,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 64eb4192bf0e6..9702c79719c64 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -11,7 +11,7 @@ pub use self::AnnNode::*; use abi; -use ast::{mod, FnUnboxedClosureKind, FnMutUnboxedClosureKind}; +use ast::{self, FnUnboxedClosureKind, FnMutUnboxedClosureKind}; use ast::{FnOnceUnboxedClosureKind}; use ast::{MethodImplItem, RegionTyParamBound, TraitTyParamBound, TraitBoundModifier}; use ast::{RequiredMethod, ProvidedMethod, TypeImplItem, TypeTraitItem}; @@ -19,17 +19,17 @@ use ast::{UnboxedClosureKind}; use ast_util; use owned_slice::OwnedSlice; use attr::{AttrMetaMethods, AttributeMethods}; -use codemap::{mod, CodeMap, BytePos}; +use codemap::{self, CodeMap, BytePos}; use diagnostic; -use parse::token::{mod, BinOpToken, Token}; +use parse::token::{self, BinOpToken, Token}; use parse::lexer::comments; use parse; -use print::pp::{mod, break_offset, word, space, zerobreak, hardbreak}; +use print::pp::{self, break_offset, word, space, zerobreak, hardbreak}; use print::pp::{Breaks, Consistent, Inconsistent, eof}; use ptr::P; use std::{ascii, mem}; -use std::io::{mod, IoResult}; +use std::io::{self, IoResult}; use std::iter; pub enum AnnNode<'a> { @@ -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/ptr.rs b/src/libsyntax/ptr.rs index a989b32372390..6eee1d903ea64 100644 --- a/src/libsyntax/ptr.rs +++ b/src/libsyntax/ptr.rs @@ -36,7 +36,7 @@ //! implementation changes (using a special thread-local heap, for example). //! Moreover, a switch to, e.g. `P<'a, T>` would be easy and mostly automated. -use std::fmt::{mod, Show}; +use std::fmt::{self, Show}; use std::hash::Hash; use std::ops::Deref; use std::ptr; 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 6e087778de9cd..5f416a867e8bd 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -92,7 +92,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 a1fe63e3f6fcd..ec6b2cfa5c396 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 b2d3611fc64fc..d54930998f153 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -73,7 +73,7 @@ use std::num::{Float, FloatMath, Int}; use std::os; use std::str::{FromStr, from_str}; use std::sync::mpsc::{channel, Sender}; -use std::thread::{mod, Thread}; +use std::thread::{self, Thread}; use std::thunk::{Thunk, Invoke}; use std::time::Duration; @@ -95,7 +95,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) @@ -114,7 +114,7 @@ impl Show for TestName { } } -#[deriving(Clone, Copy)] +#[derive(Clone, Copy)] enum NamePadding { PadNone, PadOnLeft, @@ -189,14 +189,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>) @@ -204,20 +204,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 @@ -229,7 +229,7 @@ impl Metric { } } -#[deriving(PartialEq)] +#[derive(PartialEq)] pub struct MetricMap(BTreeMap); impl Clone for MetricMap { @@ -240,7 +240,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, @@ -285,7 +285,7 @@ pub fn test_main_static(args: &[String], tests: &[TestDescAndFn]) { test_main(args, owned_tests) } -#[deriving(Copy)] +#[derive(Copy)] pub enum ColorConfig { AutoColor, AlwaysColor, @@ -510,13 +510,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, @@ -969,7 +969,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 e8ab1b548433b..7459d30b663fb 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -10,7 +10,7 @@ #![allow(missing_docs)] -use std::cmp::Ordering::{mod, Less, Greater, Equal}; +use std::cmp::Ordering::{self, Less, Greater, Equal}; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::hash_map; use std::fmt::Show; @@ -127,7 +127,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 7603d84848c9f..0dc1524a7cb6b 100644 --- a/src/libtime/lib.rs +++ b/src/libtime/lib.rs @@ -35,7 +35,7 @@ extern crate libc; pub use self::ParseError::*; use self::Fmt::*; -use std::fmt::{mod, Show}; +use std::fmt::{self, Show}; use std::num::SignedInt; use std::ops::{Add, Sub}; use std::time::Duration; @@ -80,7 +80,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, @@ -241,7 +241,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, @@ -423,7 +423,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 eabe044ce3b71..c530c950b1f6a 100644 --- a/src/libunicode/lib.rs +++ b/src/libunicode/lib.rs @@ -79,7 +79,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 8ec90acb711f0..1b0c4171134ed 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>, @@ -128,7 +128,7 @@ impl<'a> DoubleEndedIterator 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, @@ -137,7 +137,7 @@ pub struct Graphemes<'a> { } // state machine for cluster boundary rules -#[deriving(PartialEq,Eq)] +#[derive(PartialEq,Eq)] enum GraphemeState { Start, FindExtend, @@ -405,12 +405,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), @@ -503,7 +503,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/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index d92d30ca844af..44abd1d09d1d8 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -18,7 +18,7 @@ extern crate collections; use std::ascii::{AsciiExt, OwnedAsciiExt}; -use std::cmp::Ordering::{mod, Less, Greater, Equal}; +use std::cmp::Ordering::{self, Less, Greater, Equal}; use std::collections::HashMap; use std::sync::mpsc::{channel, Sender, Receiver}; use std::mem::replace; 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-impl-redirect.rs b/src/test/run-pass/associated-types-impl-redirect.rs index ce7f5dde2ad19..eb6a3111cc15b 100644 --- a/src/test/run-pass/associated-types-impl-redirect.rs +++ b/src/test/run-pass/associated-types-impl-redirect.rs @@ -20,7 +20,7 @@ #![no_implicit_prelude] use std::kinds::Sized; -use std::option::Option::{None, Some, mod}; +use std::option::Option::{None, Some, self}; trait Iterator { type Item; 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 { diff --git a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs index 7afaf290424af..8a1a090e919cc 100644 --- a/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs +++ b/src/test/run-pass/associated-types-where-clause-impl-ambiguity.rs @@ -20,7 +20,7 @@ #![no_implicit_prelude] use std::kinds::Sized; -use std::option::Option::{None, Some, mod}; +use std::option::Option::{None, Some, self}; trait Iterator { type Item; diff --git a/src/test/run-pass/use-mod.rs b/src/test/run-pass/use-mod.rs index 3f3cb634d749f..cca9c8f2df422 100644 --- a/src/test/run-pass/use-mod.rs +++ b/src/test/run-pass/use-mod.rs @@ -26,7 +26,7 @@ mod foo { } mod baz { - use super::foo::{bar, mod}; + use super::foo::{bar, self}; pub use foo::Third; }