Skip to content

Commit f107718

Browse files
committed
std: Remove Zero impl for Option
Options are not numeric types, so it doesn't make sense for them to implement Zero.
1 parent 43aba85 commit f107718

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

src/libstd/option.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,6 @@ impl<T:Zero> Option<T> {
483483
}
484484
}
485485

486-
impl<T> Zero for Option<T> {
487-
fn zero() -> Option<T> { None }
488-
fn is_zero(&self) -> bool { self.is_none() }
489-
}
490-
491486
/// An iterator that yields either one or zero elements
492487
#[deriving(Clone, DeepClone)]
493488
pub struct OptionIterator<A> {

src/test/run-pass/deriving-zero.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ struct E { a: int, b: int }
2424

2525
#[deriving(Zero)]
2626
struct Lots {
27-
c: Option<util::NonCopyable>,
2827
d: u8,
2928
e: char,
3029
f: float,

0 commit comments

Comments
 (0)