diff options
| author | bors <bors@rust-lang.org> | 2015-01-04 04:50:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-04 04:50:56 +0000 |
| commit | 470118f3e915cdc8f936aca0640b28a7a3d8dc6c (patch) | |
| tree | 47f99908d999aa612a4cd44932dcdc3b3a1a966a /src/libstd/io | |
| parent | c6c786671d692d7b13c2e5c68a53001327b4b125 (diff) | |
| parent | 351409a62287c7993bc680d9dfcfa13cba9c9c0c (diff) | |
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/io')
| -rw-r--r-- | src/libstd/io/buffered.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/mem.rs | 4 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 18 | ||||
| -rw-r--r-- | src/libstd/io/net/addrinfo.rs | 10 | ||||
| -rw-r--r-- | src/libstd/io/net/ip.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/process.rs | 12 | ||||
| -rw-r--r-- | src/libstd/io/stdio.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/util.rs | 10 |
9 files changed, 33 insertions, 33 deletions
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, } |
