about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-01-04 04:50:56 +0000
committerbors <bors@rust-lang.org>2015-01-04 04:50:56 +0000
commit470118f3e915cdc8f936aca0640b28a7a3d8dc6c (patch)
tree47f99908d999aa612a4cd44932dcdc3b3a1a966a /src/libstd
parentc6c786671d692d7b13c2e5c68a53001327b4b125 (diff)
parent351409a62287c7993bc680d9dfcfa13cba9c9c0c (diff)
downloadrust-470118f3e915cdc8f936aca0640b28a7a3d8dc6c.tar.gz
rust-470118f3e915cdc8f936aca0640b28a7a3d8dc6c.zip
auto merge of #20504 : japaric/rust/derive-self, r=alexcrichton
I put the sed scripts in the commits, in case this needs a "rebase".
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/bitflags.rs2
-rw-r--r--src/libstd/c_str.rs4
-rw-r--r--src/libstd/collections/hash/map.rs24
-rw-r--r--src/libstd/collections/hash/set.rs8
-rw-r--r--src/libstd/collections/hash/table.rs6
-rw-r--r--src/libstd/dynamic_lib.rs2
-rw-r--r--src/libstd/hash.rs6
-rw-r--r--src/libstd/io/buffered.rs2
-rw-r--r--src/libstd/io/fs.rs2
-rw-r--r--src/libstd/io/mem.rs4
-rw-r--r--src/libstd/io/mod.rs18
-rw-r--r--src/libstd/io/net/addrinfo.rs10
-rw-r--r--src/libstd/io/net/ip.rs6
-rw-r--r--src/libstd/io/process.rs12
-rw-r--r--src/libstd/io/stdio.rs2
-rw-r--r--src/libstd/io/util.rs10
-rw-r--r--src/libstd/num/mod.rs2
-rw-r--r--src/libstd/num/strconv.rs10
-rw-r--r--src/libstd/os.rs4
-rw-r--r--src/libstd/path/posix.rs6
-rw-r--r--src/libstd/path/windows.rs6
-rw-r--r--src/libstd/prelude/v1.rs4
-rw-r--r--src/libstd/rand/mod.rs2
-rw-r--r--src/libstd/rt/libunwind.rs2
-rw-r--r--src/libstd/rt/mod.rs2
-rw-r--r--src/libstd/rt/unwind.rs2
-rw-r--r--src/libstd/rt/util.rs2
-rw-r--r--src/libstd/sync/atomic.rs2
-rw-r--r--src/libstd/sync/condvar.rs4
-rw-r--r--src/libstd/sync/mpsc/blocking.rs2
-rw-r--r--src/libstd/sync/mpsc/mod.rs8
-rw-r--r--src/libstd/sync/mpsc/oneshot.rs2
-rw-r--r--src/libstd/sync/mpsc/select.rs4
-rw-r--r--src/libstd/sync/mpsc/shared.rs2
-rw-r--r--src/libstd/sync/mpsc/stream.rs2
-rw-r--r--src/libstd/sync/mpsc/sync.rs6
-rw-r--r--src/libstd/sync/mutex.rs2
-rw-r--r--src/libstd/sync/rwlock.rs4
-rw-r--r--src/libstd/sys/common/condvar.rs2
-rw-r--r--src/libstd/sys/common/mod.rs2
-rw-r--r--src/libstd/sys/common/net.rs10
-rw-r--r--src/libstd/sys/common/thread_local.rs2
-rw-r--r--src/libstd/sys/unix/backtrace.rs2
-rw-r--r--src/libstd/sys/unix/condvar.rs2
-rw-r--r--src/libstd/sys/unix/fs.rs2
-rw-r--r--src/libstd/sys/unix/mod.rs2
-rw-r--r--src/libstd/sys/unix/os.rs2
-rw-r--r--src/libstd/sys/unix/pipe.rs4
-rw-r--r--src/libstd/sys/unix/process.rs6
-rw-r--r--src/libstd/sys/unix/tty.rs4
-rw-r--r--src/libstd/sys/windows/condvar.rs4
-rw-r--r--src/libstd/sys/windows/fs.rs2
-rw-r--r--src/libstd/sys/windows/helper_signal.rs2
-rw-r--r--src/libstd/sys/windows/mod.rs2
-rw-r--r--src/libstd/sys/windows/mutex.rs2
-rw-r--r--src/libstd/sys/windows/pipe.rs4
-rw-r--r--src/libstd/sys/windows/process.rs2
-rw-r--r--src/libstd/sys/windows/tcp.rs4
-rw-r--r--src/libstd/sys/windows/tty.rs2
-rw-r--r--src/libstd/thread.rs6
-rw-r--r--src/libstd/thread_local/mod.rs2
-rw-r--r--src/libstd/time/duration.rs2
62 files changed, 136 insertions, 136 deletions
diff --git a/src/libstd/bitflags.rs b/src/libstd/bitflags.rs
index 16bc6b16598..65cbce08543 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 834a9f082d0..4fb4f220c59 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 f246e9df3b9..c63484396d2 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<K, V, H = RandomSipHasher> {
     // 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<Vec<int>> = 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 4c6a74a78d5..28c78ca3a91 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<T, H = RandomSipHasher> {
     map: HashMap<T, (), H>
diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs
index 2b999d83a98..7c87094805d 100644
--- a/src/libstd/collections/hash/table.rs
+++ b/src/libstd/collections/hash/table.rs
@@ -124,7 +124,7 @@ struct GapThenFull<K, V, M> {
 
 /// 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 ecfe2d15ae1..de3d75ffb32 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 737fef23c74..cdd0e9bf76f 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 852cab500f6..d97f4a7bc34 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 1ff54fcb484..5cb79d41db9 100644
--- a/src/libstd/io/fs.rs
+++ b/src/libstd/io/fs.rs
@@ -558,7 +558,7 @@ pub fn walk_dir(path: &Path) -> IoResult<Directories> {
 }
 
 /// An iterator that walks over a directory
-#[deriving(Clone)]
+#[derive(Clone)]
 pub struct Directories {
     stack: Vec<Path>,
 }
diff --git a/src/libstd/io/mem.rs b/src/libstd/io/mem.rs
index ad921e43c0c..1615541e37d 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<u8> {
 /// assert_eq!(w.into_inner(), vec!(0, 1, 2));
 /// ```
 #[deprecated = "use the Vec<u8> Writer implementation directly"]
-#[deriving(Clone)]
+#[derive(Clone)]
 pub struct MemWriter {
     buf: Vec<u8>,
 }
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 917ffa4ff76..590231dcd82 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -301,7 +301,7 @@ pub type IoResult<T> = Result<T, IoError>;
 /// # 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<IoError> for Box<Error> {
 }
 
 /// 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<T: Buffer> 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 d86cb841f96..24d45dcd652 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<SocketType>,
@@ -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 eeb858a1887..52b589b5f24 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 fedc102e45d..5886c9cc3e2 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<EnvKey, CString>;
 ///
 /// 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<EnvKey, CString> 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 cd991c5f884..f571bed3ba2 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<Mutex<RaceBox>>,
 }
diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs
index 51d1bacf63b..1381ad17ea2 100644
--- a/src/libstd/io/util.rs
+++ b/src/libstd/io/util.rs
@@ -81,7 +81,7 @@ impl<R: Buffer> Buffer for LimitReader<R> {
 }
 
 /// 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<I, R> {
     readers: I,
     cur_reader: Option<R>,
@@ -247,7 +247,7 @@ pub fn copy<R: Reader, W: Writer>(r: &mut R, w: &mut W) -> io::IoResult<()> {
 }
 
 /// An adaptor converting an `Iterator<u8>` to a `Reader`.
-#[deriving(Clone)]
+#[derive(Clone)]
 pub struct IterReader<T> {
     iter: T,
 }
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs
index 007d89a942d..8f21fb0b8b9 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 6c64251091a..20dd70f0faa 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 2ca6bccabc0..771c808ab8a 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -361,7 +361,7 @@ pub fn join_paths<T: BytesContainer>(paths: &[T]) -> Result<Vec<u8>, &'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 39b96ef6aee..ae82e201cb8 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<u8>, // assumed to never be empty or contain NULs
     sepidx: Option<uint> // 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 f6fb149e82c..aae8d6cadef 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<PathPrefix>,
@@ -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 2d2f3f895d0..a122cb81b8c 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 208e4f9e566..55063f1393f 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 3fdfb5327ee..7cc39d7d972 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 68aaa1b3ae5..2b0639c5705 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 6f6be2e111d..99f791df474 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 09859cab536..d6cf35ee3cd 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 d4d7607bde3..3652b45ce97 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 19b8f5e62cf..28c36922ca6 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 a5299012723..faff5f09f81 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<Inner>,
 }
diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs
index e9dc3d986ba..de1724cbc4e 100644
--- a/src/libstd/sync/mpsc/mod.rs
+++ b/src/libstd/sync/mpsc/mod.rs
@@ -379,7 +379,7 @@ pub struct SyncSender<T> {
 /// 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<T>(pub T);
 
@@ -387,13 +387,13 @@ pub struct SendError<T>(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<T> {
     /// 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 5f599752a46..2811f403c6c 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 3d9dca7e21c..16adbf5aa4f 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 e15c38cf9a1..cadac8e6272 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 01b799283ee..c526e6acb8f 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 98f1c4c46f9..0eee10898bc 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<T> {
     /// Only field outside of the mutex. Just done for kicks, but mainly because
@@ -103,7 +103,7 @@ struct Buffer<T> {
     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 f9f9a809221..b158bd69c7b 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 431aeb9cae9..b2367ff8352 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 e09d9704029..32fa6ec5903 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 97015f74a4a..a441e55a732 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 94a2c9b78fa..3f67b284f68 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 9d7188a37bc..158fd3a8382 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 9e26475f814..5b261ea6b9e 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 f64718539ef..3aa4825f3be 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 e3e0b279c12..b49ace8e2f8 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 4199cbc1bb9..ea0d230e8b2 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 6a8f55e79c8..690574301d7 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 623f3f6a89c..fcbfb383d3c 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 af09bf4fbd0..b73919fe2a2 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 4ef687d41d8..bee3d440a16 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 7f9d669c447..291a8024cfc 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 523d60c71aa..9a942300656 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 c547c79e83a..a9fb2c68227 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 1034f0615d9..0e706c3cc6a 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 e0fa02b5599..f561e0121b3 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 f173d5fc6d4..0edae75a9ce 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 cb99a886ce4..81e8f974a12 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 5a929f6b2b5..1c8ec2a80a7 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 7591025d76d..4305f7743b5 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 3c87309dabc..9c8a5fc239c 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<Inner>,
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs
index 91d8aec01cf..d3b4fab9681 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 41a130492c0..d48b0342b3b 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