diff --git a/src/librustc/middle/trans/adt.rs b/src/librustc/middle/trans/adt.rs index ad07f41f8c3..9ae241c7030 100644 --- a/src/librustc/middle/trans/adt.rs +++ b/src/librustc/middle/trans/adt.rs @@ -165,7 +165,7 @@ fn represent_type_uncached(cx: &mut CrateContext, t: ty::t) -> Repr { if cases.all(|c| c.tys.len() == 0) { // All bodies empty -> intlike let discrs = cases.map(|c| c.discr); - return CEnum(discrs.min(), discrs.max()); + return CEnum(*discrs.iter().min().unwrap(), *discrs.iter().max().unwrap()); } if cases.len() == 1 { @@ -509,7 +509,7 @@ pub fn trans_const(ccx: &mut CrateContext, r: &Repr, discr: int, } General(ref cases) => { let case = &cases[discr as uint]; - let max_sz = cases.map(|s| s.size).max(); + let max_sz = cases.iter().transform(|x| x.size).max().unwrap(); let discr_ty = C_int(ccx, discr); let contents = build_const_struct(ccx, case, ~[discr_ty] + vals); diff --git a/src/libstd/old_iter.rs b/src/libstd/old_iter.rs index 9fea4376816..39f3a81ad21 100644 --- a/src/libstd/old_iter.rs +++ b/src/libstd/old_iter.rs @@ -54,11 +54,6 @@ pub trait CopyableIter { fn find(&self, p: &fn(&A) -> bool) -> Option; } -pub trait CopyableOrderedIter { - fn min(&self) -> A; - fn max(&self) -> A; -} - // A trait for sequences that can be built by imperatively pushing elements // onto them. pub trait Buildable { diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index 61b8d36266e..60165ed5dae 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -47,9 +47,9 @@ pub use char::Char; pub use container::{Container, Mutable, Map, Set}; pub use hash::Hash; pub use old_iter::{BaseIter, ReverseIter, ExtendedIter, EqIter}; -pub use old_iter::{CopyableIter, CopyableOrderedIter}; +pub use old_iter::CopyableIter; pub use iter::{Times, FromIter}; -pub use iterator::{Iterator, IteratorUtil}; +pub use iterator::{Iterator, IteratorUtil, OrdIterator}; pub use num::{Num, NumCast}; pub use num::{Orderable, Signed, Unsigned, Round}; pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic}; diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 44f3fc4c321..7b4764164b5 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -2619,23 +2619,6 @@ impl old_iter::CopyableIter for @[A] { } } -impl<'self,A:Copy + Ord> old_iter::CopyableOrderedIter for &'self [A] { - fn min(&self) -> A { old_iter::min(self) } - fn max(&self) -> A { old_iter::max(self) } -} - -// FIXME(#4148): This should be redundant -impl old_iter::CopyableOrderedIter for ~[A] { - fn min(&self) -> A { old_iter::min(self) } - fn max(&self) -> A { old_iter::max(self) } -} - -// FIXME(#4148): This should be redundant -impl old_iter::CopyableOrderedIter for @[A] { - fn min(&self) -> A { old_iter::min(self) } - fn max(&self) -> A { old_iter::max(self) } -} - impl Clone for ~[A] { #[inline] fn clone(&self) -> ~[A] { diff --git a/src/libsyntax/opt_vec.rs b/src/libsyntax/opt_vec.rs index 791f7444b62..67e712f0596 100644 --- a/src/libsyntax/opt_vec.rs +++ b/src/libsyntax/opt_vec.rs @@ -196,10 +196,3 @@ impl old_iter::CopyableIter for OptVec { old_iter::find(self, f) } } - -impl old_iter::CopyableOrderedIter for OptVec { - #[inline(always)] - fn min(&self) -> A { old_iter::min(self) } - #[inline(always)] - fn max(&self) -> A { old_iter::max(self) } -}