Skip to content

Commit 3c06a03

Browse files
committed
core: Derive Show impls wherever possible
These were temporarily moved to explicit implementations, but now that fmt is in core it's possible to derive again.
1 parent 27d8ea0 commit 3c06a03

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/libcore/cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub trait TotalEq: Eq {
8282
}
8383

8484
/// An ordering is, e.g, a result of a comparison between two values.
85-
#[deriving(Clone, Eq)]
85+
#[deriving(Clone, Eq, Show)]
8686
pub enum Ordering {
8787
/// An ordering where a compared value is less [than another].
8888
Less = -1,

src/libcore/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ extern "rust-intrinsic" {
471471
/// `TypeId` represents a globally unique identifier for a type
472472
#[lang="type_id"] // This needs to be kept in lockstep with the code in trans/intrinsic.rs and
473473
// middle/lang_items.rs
474-
#[deriving(Eq, TotalEq)]
474+
#[deriving(Eq, TotalEq, Show)]
475475
#[cfg(not(test))]
476476
pub struct TypeId {
477477
t: u64,

src/libcore/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ impl<A: TotalOrd, T: Iterator<A>> OrdIterator<A> for T {
969969
}
970970

971971
/// `MinMaxResult` is an enum returned by `min_max`. See `OrdIterator::min_max` for more detail.
972-
#[deriving(Clone, Eq)]
972+
#[deriving(Clone, Eq, Show)]
973973
pub enum MinMaxResult<T> {
974974
/// Empty iterator
975975
NoElements,

src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ use mem;
148148
use slice;
149149

150150
/// The `Option`
151-
#[deriving(Clone, Eq, Ord, TotalEq, TotalOrd)]
151+
#[deriving(Clone, Eq, Ord, TotalEq, TotalOrd, Show)]
152152
pub enum Option<T> {
153153
/// No value
154154
None,

src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ use option::{None, Option, Some};
275275
/// `Result` is a type that represents either success (`Ok`) or failure (`Err`).
276276
///
277277
/// See the [`std::result`](index.html) module documentation for details.
278-
#[deriving(Clone, Eq, Ord, TotalEq, TotalOrd)]
278+
#[deriving(Clone, Eq, Ord, TotalEq, TotalOrd, Show)]
279279
#[must_use]
280280
pub enum Result<T, E> {
281281
/// Contains the success value

src/libcore/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ pub struct UTF16Items<'a> {
542542
iter: slice::Items<'a, u16>
543543
}
544544
/// The possibilities for values decoded from a `u16` stream.
545-
#[deriving(Eq, TotalEq, Clone)]
545+
#[deriving(Eq, TotalEq, Clone, Show)]
546546
pub enum UTF16Item {
547547
/// A valid codepoint.
548548
ScalarValue(char),

0 commit comments

Comments
 (0)