mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-14 16:53:29 +00:00
rm CopyableOrderedIter
replaced with OrdIterator
This commit is contained in:
parent
6c547e42c8
commit
e097d5eaba
@ -165,7 +165,7 @@ fn represent_type_uncached(cx: &mut CrateContext, t: ty::t) -> Repr {
|
|||||||
if cases.all(|c| c.tys.len() == 0) {
|
if cases.all(|c| c.tys.len() == 0) {
|
||||||
// All bodies empty -> intlike
|
// All bodies empty -> intlike
|
||||||
let discrs = cases.map(|c| c.discr);
|
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 {
|
if cases.len() == 1 {
|
||||||
@ -509,7 +509,7 @@ pub fn trans_const(ccx: &mut CrateContext, r: &Repr, discr: int,
|
|||||||
}
|
}
|
||||||
General(ref cases) => {
|
General(ref cases) => {
|
||||||
let case = &cases[discr as uint];
|
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 discr_ty = C_int(ccx, discr);
|
||||||
let contents = build_const_struct(ccx, case,
|
let contents = build_const_struct(ccx, case,
|
||||||
~[discr_ty] + vals);
|
~[discr_ty] + vals);
|
||||||
|
@ -54,11 +54,6 @@ pub trait CopyableIter<A:Copy> {
|
|||||||
fn find(&self, p: &fn(&A) -> bool) -> Option<A>;
|
fn find(&self, p: &fn(&A) -> bool) -> Option<A>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait CopyableOrderedIter<A:Copy + Ord> {
|
|
||||||
fn min(&self) -> A;
|
|
||||||
fn max(&self) -> A;
|
|
||||||
}
|
|
||||||
|
|
||||||
// A trait for sequences that can be built by imperatively pushing elements
|
// A trait for sequences that can be built by imperatively pushing elements
|
||||||
// onto them.
|
// onto them.
|
||||||
pub trait Buildable<A> {
|
pub trait Buildable<A> {
|
||||||
|
@ -47,9 +47,9 @@ pub use char::Char;
|
|||||||
pub use container::{Container, Mutable, Map, Set};
|
pub use container::{Container, Mutable, Map, Set};
|
||||||
pub use hash::Hash;
|
pub use hash::Hash;
|
||||||
pub use old_iter::{BaseIter, ReverseIter, ExtendedIter, EqIter};
|
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 iter::{Times, FromIter};
|
||||||
pub use iterator::{Iterator, IteratorUtil};
|
pub use iterator::{Iterator, IteratorUtil, OrdIterator};
|
||||||
pub use num::{Num, NumCast};
|
pub use num::{Num, NumCast};
|
||||||
pub use num::{Orderable, Signed, Unsigned, Round};
|
pub use num::{Orderable, Signed, Unsigned, Round};
|
||||||
pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};
|
pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};
|
||||||
|
@ -2619,23 +2619,6 @@ impl<A:Copy> old_iter::CopyableIter<A> for @[A] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'self,A:Copy + Ord> old_iter::CopyableOrderedIter<A> 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<A:Copy + Ord> old_iter::CopyableOrderedIter<A> 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<A:Copy + Ord> old_iter::CopyableOrderedIter<A> for @[A] {
|
|
||||||
fn min(&self) -> A { old_iter::min(self) }
|
|
||||||
fn max(&self) -> A { old_iter::max(self) }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<A:Clone> Clone for ~[A] {
|
impl<A:Clone> Clone for ~[A] {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn clone(&self) -> ~[A] {
|
fn clone(&self) -> ~[A] {
|
||||||
|
@ -196,10 +196,3 @@ impl<A: Copy> old_iter::CopyableIter<A> for OptVec<A> {
|
|||||||
old_iter::find(self, f)
|
old_iter::find(self, f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<A: Copy+Ord> old_iter::CopyableOrderedIter<A> for OptVec<A> {
|
|
||||||
#[inline(always)]
|
|
||||||
fn min(&self) -> A { old_iter::min(self) }
|
|
||||||
#[inline(always)]
|
|
||||||
fn max(&self) -> A { old_iter::max(self) }
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user