Skip to content

Commit 9a63be1

Browse files
committed
option: rm implementation of Add
Closes #6002 There is consensus that the current implementation should be changed or removed, so removing it seems like the right decision for now.
1 parent c6eb3ec commit 9a63be1

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

src/libstd/option.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ let unwrapped_msg = match msg {
4343

4444
use clone::Clone;
4545
use cmp::{Eq,Ord};
46-
use ops::Add;
4746
use util;
4847
use num::Zero;
4948
use iterator;
@@ -77,18 +76,6 @@ impl<T: Eq + Ord> Ord for Option<T> {
7776
}
7877
}
7978

80-
impl<T: Add<T, T>> Add<Option<T>, Option<T>> for Option<T> {
81-
#[inline]
82-
fn add(&self, other: &Option<T>) -> Option<T> {
83-
match (&*self, &*other) {
84-
(&None, &None) => None,
85-
(_, &None) => None,
86-
(&None, _) => None,
87-
(&Some(ref lhs), &Some(ref rhs)) => Some(*lhs + *rhs)
88-
}
89-
}
90-
}
91-
9279
// FIXME: #8242 implementing manually because deriving doesn't work for some reason
9380
impl<T: ToStr> ToStr for Option<T> {
9481
fn to_str(&self) -> ~str {

src/test/run-pass/option_addition.rs

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)