rollup merge of #20250: ipetkov/deriving

* Both enums already derived `Copy`, but storing them in any
  struct/container would prevent implementing `Clone` for said
  struct/container even though they should be clonable.
* Also add PartialEq and Eq for good measure.
This commit is contained in:
Alex Crichton 2014-12-29 16:36:22 -08:00
commit 1c61e74518
1 changed files with 2 additions and 2 deletions

View File

@ -1724,7 +1724,7 @@ pub fn standard_error(kind: IoErrorKind) -> IoError {
/// A mode specifies how a file should be opened or created. These modes are /// 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 /// passed to `File::open_mode` and are used to control where the file is
/// positioned when it is initially opened. /// positioned when it is initially opened.
#[deriving(Copy)] #[deriving(Copy, Clone, PartialEq, Eq)]
pub enum FileMode { pub enum FileMode {
/// Opens a file positioned at the beginning. /// Opens a file positioned at the beginning.
Open, Open,
@ -1736,7 +1736,7 @@ pub enum FileMode {
/// Access permissions with which the file should be opened. `File`s /// Access permissions with which the file should be opened. `File`s
/// opened with `Read` will return an error if written to. /// opened with `Read` will return an error if written to.
#[deriving(Copy)] #[deriving(Copy, Clone, PartialEq, Eq)]
pub enum FileAccess { pub enum FileAccess {
/// Read-only access, requests to write will result in an error /// Read-only access, requests to write will result in an error
Read, Read,