Skip to content

Commit aedfffb

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 165881 b: refs/heads/try c: a77e8a6 h: refs/heads/master i: 165879: 40da85e v: v3
1 parent b61cd51 commit aedfffb

File tree

14 files changed

+31
-82
lines changed

14 files changed

+31
-82
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 18842f89f084c52588fe7cffe07f87bf6e90796a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 658529467d9d69ac9e09cacf98a6d61d781c2c76
5-
refs/heads/try: 2df30a47e2e0ef563d9ed80cb3cc258cbea0f53a
5+
refs/heads/try: a77e8a63d5d4c0fa04a878995824e727870135f9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libstd/ascii.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use core::kinds::Sized;
1919
use fmt;
2020
use iter::IteratorExt;
21-
use kinds::Copy;
2221
use mem;
2322
use ops::FnMut;
2423
use option::Option;
@@ -29,11 +28,9 @@ use string::{String, IntoString};
2928
use vec::Vec;
3029

3130
/// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero.
32-
#[deriving(Clone, PartialEq, PartialOrd, Ord, Eq, Hash)]
31+
#[deriving(Clone, Copy, PartialEq, PartialOrd, Ord, Eq, Hash)]
3332
pub struct Ascii { chr: u8 }
3433

35-
impl Copy for Ascii {}
36-
3734
impl Ascii {
3835
/// Converts an ascii character into a `u8`.
3936
#[inline]

branches/try/src/libstd/comm/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ pub struct SyncSender<T> {
391391

392392
/// This enumeration is the list of the possible reasons that try_recv could not
393393
/// return data when called.
394-
#[deriving(PartialEq, Clone, Show)]
394+
#[deriving(PartialEq, Clone, Copy, Show)]
395395
#[experimental = "this is likely to be removed in changing try_recv()"]
396396
pub enum TryRecvError {
397397
/// This channel is currently empty, but the sender(s) have not yet
@@ -402,8 +402,6 @@ pub enum TryRecvError {
402402
Disconnected,
403403
}
404404

405-
impl Copy for TryRecvError {}
406-
407405
/// This enumeration is the list of the possible error outcomes for the
408406
/// `SyncSender::try_send` method.
409407
#[deriving(PartialEq, Clone, Show)]

branches/try/src/libstd/dynamic_lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ pub mod dl {
215215

216216
use c_str::{CString, ToCStr};
217217
use libc;
218-
use kinds::Copy;
219218
use ops::FnOnce;
220219
use ptr;
221220
use result::*;
@@ -265,15 +264,14 @@ pub mod dl {
265264
dlclose(handle as *mut libc::c_void); ()
266265
}
267266

267+
#[deriving(Copy)]
268268
pub enum Rtld {
269269
Lazy = 1,
270270
Now = 2,
271271
Global = 256,
272272
Local = 0,
273273
}
274274

275-
impl Copy for Rtld {}
276-
277275
#[link_name = "dl"]
278276
extern {
279277
fn dlopen(filename: *const libc::c_char,

branches/try/src/libstd/io/mod.rs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ use error::{FromError, Error};
232232
use fmt;
233233
use int;
234234
use iter::{Iterator, IteratorExt};
235-
use kinds::Copy;
236235
use mem::transmute;
237236
use ops::{BitOr, BitXor, BitAnd, Sub, Not, FnOnce};
238237
use option::Option;
@@ -367,7 +366,7 @@ impl FromError<IoError> for Box<Error> {
367366
}
368367

369368
/// A list specifying general categories of I/O error.
370-
#[deriving(PartialEq, Eq, Clone, Show)]
369+
#[deriving(Copy, PartialEq, Eq, Clone, Show)]
371370
pub enum IoErrorKind {
372371
/// Any I/O error not part of this list.
373372
OtherIoError,
@@ -422,8 +421,6 @@ pub enum IoErrorKind {
422421
NoProgress,
423422
}
424423

425-
impl Copy for IoErrorKind {}
426-
427424
/// A trait that lets you add a `detail` to an IoError easily
428425
trait UpdateIoError<T> {
429426
/// Returns an IoError with updated description and detail
@@ -1561,6 +1558,7 @@ impl<T: Buffer> BufferPrelude for T {
15611558

15621559
/// When seeking, the resulting cursor is offset from a base by the offset given
15631560
/// to the `seek` function. The base used is specified by this enumeration.
1561+
#[deriving(Copy)]
15641562
pub enum SeekStyle {
15651563
/// Seek from the beginning of the stream
15661564
SeekSet,
@@ -1570,8 +1568,6 @@ pub enum SeekStyle {
15701568
SeekCur,
15711569
}
15721570

1573-
impl Copy for SeekStyle {}
1574-
15751571
/// An object implementing `Seek` internally has some form of cursor which can
15761572
/// be moved within a stream of bytes. The stream typically has a fixed size,
15771573
/// allowing seeking relative to either end.
@@ -1685,6 +1681,7 @@ pub fn standard_error(kind: IoErrorKind) -> IoError {
16851681
/// A mode specifies how a file should be opened or created. These modes are
16861682
/// passed to `File::open_mode` and are used to control where the file is
16871683
/// positioned when it is initially opened.
1684+
#[deriving(Copy)]
16881685
pub enum FileMode {
16891686
/// Opens a file positioned at the beginning.
16901687
Open,
@@ -1694,10 +1691,9 @@ pub enum FileMode {
16941691
Truncate,
16951692
}
16961693

1697-
impl Copy for FileMode {}
1698-
16991694
/// Access permissions with which the file should be opened. `File`s
17001695
/// opened with `Read` will return an error if written to.
1696+
#[deriving(Copy)]
17011697
pub enum FileAccess {
17021698
/// Read-only access, requests to write will result in an error
17031699
Read,
@@ -1707,10 +1703,8 @@ pub enum FileAccess {
17071703
ReadWrite,
17081704
}
17091705

1710-
impl Copy for FileAccess {}
1711-
17121706
/// Different kinds of files which can be identified by a call to stat
1713-
#[deriving(PartialEq, Show, Hash, Clone)]
1707+
#[deriving(Copy, PartialEq, Show, Hash, Clone)]
17141708
pub enum FileType {
17151709
/// This is a normal file, corresponding to `S_IFREG`
17161710
RegularFile,
@@ -1731,8 +1725,6 @@ pub enum FileType {
17311725
Unknown,
17321726
}
17331727

1734-
impl Copy for FileType {}
1735-
17361728
/// A structure used to describe metadata information about a file. This
17371729
/// structure is created through the `stat` method on a `Path`.
17381730
///
@@ -1750,7 +1742,7 @@ impl Copy for FileType {}
17501742
/// println!("byte size: {}", info.size);
17511743
/// # }
17521744
/// ```
1753-
#[deriving(Hash)]
1745+
#[deriving(Copy, Hash)]
17541746
pub struct FileStat {
17551747
/// The size of the file, in bytes
17561748
pub size: u64,
@@ -1784,14 +1776,12 @@ pub struct FileStat {
17841776
pub unstable: UnstableFileStat,
17851777
}
17861778

1787-
impl Copy for FileStat {}
1788-
17891779
/// This structure represents all of the possible information which can be
17901780
/// returned from a `stat` syscall which is not contained in the `FileStat`
17911781
/// structure. This information is not necessarily platform independent, and may
17921782
/// have different meanings or no meaning at all on some platforms.
17931783
#[unstable]
1794-
#[deriving(Hash)]
1784+
#[deriving(Copy, Hash)]
17951785
pub struct UnstableFileStat {
17961786
/// The ID of the device containing the file.
17971787
pub device: u64,
@@ -1815,8 +1805,6 @@ pub struct UnstableFileStat {
18151805
pub gen: u64,
18161806
}
18171807

1818-
impl Copy for UnstableFileStat {}
1819-
18201808
bitflags! {
18211809
#[doc = "A set of permissions for a file or directory is represented"]
18221810
#[doc = "by a set of flags which are or'd together."]

branches/try/src/libstd/io/net/addrinfo.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,22 @@ pub use self::Protocol::*;
2222
use iter::IteratorExt;
2323
use io::{IoResult};
2424
use io::net::ip::{SocketAddr, IpAddr};
25-
use kinds::Copy;
2625
use option::Option;
2726
use option::Option::{Some, None};
2827
use sys;
2928
use vec::Vec;
3029

3130
/// Hints to the types of sockets that are desired when looking up hosts
31+
#[deriving(Copy)]
3232
pub enum SocketType {
3333
Stream, Datagram, Raw
3434
}
3535

36-
impl Copy for SocketType {}
37-
3836
/// Flags which can be or'd into the `flags` field of a `Hint`. These are used
3937
/// to manipulate how a query is performed.
4038
///
4139
/// The meaning of each of these flags can be found with `man -s 3 getaddrinfo`
40+
#[deriving(Copy)]
4241
pub enum Flag {
4342
AddrConfig,
4443
All,
@@ -49,30 +48,27 @@ pub enum Flag {
4948
V4Mapped,
5049
}
5150

52-
impl Copy for Flag {}
53-
5451
/// A transport protocol associated with either a hint or a return value of
5552
/// `lookup`
53+
#[deriving(Copy)]
5654
pub enum Protocol {
5755
TCP, UDP
5856
}
5957

60-
impl Copy for Protocol {}
61-
6258
/// This structure is used to provide hints when fetching addresses for a
6359
/// remote host to control how the lookup is performed.
6460
///
6561
/// For details on these fields, see their corresponding definitions via
6662
/// `man -s 3 getaddrinfo`
63+
#[deriving(Copy)]
6764
pub struct Hint {
6865
pub family: uint,
6966
pub socktype: Option<SocketType>,
7067
pub protocol: Option<Protocol>,
7168
pub flags: uint,
7269
}
7370

74-
impl Copy for Hint {}
75-
71+
#[deriving(Copy)]
7672
pub struct Info {
7773
pub address: SocketAddr,
7874
pub family: uint,
@@ -81,8 +77,6 @@ pub struct Info {
8177
pub flags: uint,
8278
}
8379

84-
impl Copy for Info {}
85-
8680
/// Easy name resolution. Given a hostname, returns the list of IP addresses for
8781
/// that hostname.
8882
pub fn get_host_addresses(host: &str) -> IoResult<Vec<IpAddr>> {

branches/try/src/libstd/io/net/ip.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
pub use self::IpAddr::*;
1919

2020
use fmt;
21-
use kinds::Copy;
2221
use io::{mod, IoResult, IoError};
2322
use io::net;
2423
use iter::{Iterator, IteratorExt};
@@ -32,14 +31,12 @@ use vec::Vec;
3231

3332
pub type Port = u16;
3433

35-
#[deriving(PartialEq, Eq, Clone, Hash)]
34+
#[deriving(Copy, PartialEq, Eq, Clone, Hash)]
3635
pub enum IpAddr {
3736
Ipv4Addr(u8, u8, u8, u8),
3837
Ipv6Addr(u16, u16, u16, u16, u16, u16, u16, u16)
3938
}
4039

41-
impl Copy for IpAddr {}
42-
4340
impl fmt::Show for IpAddr {
4441
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
4542
match *self {
@@ -65,14 +62,12 @@ impl fmt::Show for IpAddr {
6562
}
6663
}
6764

68-
#[deriving(PartialEq, Eq, Clone, Hash)]
65+
#[deriving(Copy, PartialEq, Eq, Clone, Hash)]
6966
pub struct SocketAddr {
7067
pub ip: IpAddr,
7168
pub port: Port,
7269
}
7370

74-
impl Copy for SocketAddr {}
75-
7671
impl fmt::Show for SocketAddr {
7772
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7873
match self.ip {

branches/try/src/libstd/io/process.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ pub struct ProcessOutput {
461461
}
462462

463463
/// Describes what to do with a standard io stream for a child process.
464-
#[deriving(Clone)]
464+
#[deriving(Clone, Copy)]
465465
pub enum StdioContainer {
466466
/// This stream will be ignored. This is the equivalent of attaching the
467467
/// stream to `/dev/null`
@@ -481,11 +481,9 @@ pub enum StdioContainer {
481481
CreatePipe(bool /* readable */, bool /* writable */),
482482
}
483483

484-
impl Copy for StdioContainer {}
485-
486484
/// Describes the result of a process after it has terminated.
487485
/// Note that Windows have no signals, so the result is usually ExitStatus.
488-
#[deriving(PartialEq, Eq, Clone)]
486+
#[deriving(PartialEq, Eq, Clone, Copy)]
489487
pub enum ProcessExit {
490488
/// Normal termination with an exit status.
491489
ExitStatus(int),
@@ -494,8 +492,6 @@ pub enum ProcessExit {
494492
ExitSignal(int),
495493
}
496494

497-
impl Copy for ProcessExit {}
498-
499495
impl fmt::Show for ProcessExit {
500496
/// Format a ProcessExit enum, to nicely present the information.
501497
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

branches/try/src/libstd/io/util.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,18 @@ impl<R: Buffer> Buffer for LimitReader<R> {
8181
}
8282

8383
/// A `Writer` which ignores bytes written to it, like /dev/null.
84+
#[deriving(Copy)]
8485
pub struct NullWriter;
8586

86-
impl Copy for NullWriter {}
87-
8887
impl Writer for NullWriter {
8988
#[inline]
9089
fn write(&mut self, _buf: &[u8]) -> io::IoResult<()> { Ok(()) }
9190
}
9291

9392
/// A `Reader` which returns an infinite stream of 0 bytes, like /dev/zero.
93+
#[deriving(Copy)]
9494
pub struct ZeroReader;
9595

96-
impl Copy for ZeroReader {}
97-
9896
impl Reader for ZeroReader {
9997
#[inline]
10098
fn read(&mut self, buf: &mut [u8]) -> io::IoResult<uint> {
@@ -113,10 +111,9 @@ impl Buffer for ZeroReader {
113111
}
114112

115113
/// A `Reader` which is always at EOF, like /dev/null.
114+
#[deriving(Copy)]
116115
pub struct NullReader;
117116

118-
impl Copy for NullReader {}
119-
120117
impl Reader for NullReader {
121118
#[inline]
122119
fn read(&mut self, _buf: &mut [u8]) -> io::IoResult<uint> {

0 commit comments

Comments
 (0)