diff --git a/components/util/lib.rs b/components/util/lib.rs index bceab7a3014..3736b6a5a09 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -5,7 +5,6 @@ #![feature(unsafe_destructor)] #![feature(plugin)] #![feature(int_uint)] -#![feature(old_impl_check)] #![feature(box_syntax)] #![deny(unused_imports)] diff --git a/components/util/range.rs b/components/util/range.rs index fbf14f38400..8c217beb218 100644 --- a/components/util/range.rs +++ b/components/util/range.rs @@ -9,12 +9,14 @@ use std::num; use std::num::Int; /// An index type to be used by a `Range` -pub trait RangeIndex: Int + fmt::Show { - fn new(x: T) -> Self; - fn get(self) -> T; +pub trait RangeIndex: Int + fmt::Show { + type Index; + fn new(x: Self::Index) -> Self; + fn get(self) -> Self::Index; } -impl RangeIndex for int { +impl RangeIndex for int { + type Index = int; #[inline] fn new(x: int) -> int { x } @@ -37,7 +39,8 @@ macro_rules! int_range_index { } } - impl RangeIndex<$T> for $Self { + impl RangeIndex for $Self { + type Index = $T; #[inline] fn new(x: $T) -> $Self { $Self(x) @@ -191,8 +194,7 @@ pub struct Range { length: I, } -#[old_impl_check] -impl, T> fmt::Show for Range { +impl fmt::Show for Range { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "[{:?} .. {:?})", self.begin(), self.end()) } @@ -203,11 +205,11 @@ pub struct EachIndex { it: iter::Range, } -pub fn each_index>(start: I, stop: I) -> EachIndex { +pub fn each_index>(start: I, stop: I) -> EachIndex { EachIndex { it: iter::range(start.get(), stop.get()) } } -impl> Iterator for EachIndex { +impl> Iterator for EachIndex { type Item = I; #[inline] @@ -221,8 +223,7 @@ impl> Iterator for EachIndex { } } -#[old_impl_check] -impl, T> Range { +impl Range { /// Create a new range from beginning and length offsets. This could be /// denoted as `[begin, begin + length)`. /// @@ -359,8 +360,7 @@ impl, T> Range { } /// Methods for `Range`s with indices based on integer values -#[old_impl_check] -impl> Range { +impl> Range { /// Returns an iterater that increments over `[begin, end)`. #[inline] pub fn each_index(&self) -> EachIndex {