Rename FullRange to RangeFull
This commit is contained in:
parent
c64a96d385
commit
bf2b473816
17 changed files with 134 additions and 31 deletions
|
|
@ -8,6 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use ::core::ops::RangeFull;
|
||||
|
||||
fn test<T : Clone>(arg: T) -> T {
|
||||
arg.clone()
|
||||
}
|
||||
|
|
@ -20,7 +22,7 @@ fn main() {
|
|||
assert!(test(1..5) == (1..5));
|
||||
assert!(test(..5) == (..5));
|
||||
assert!(test(1..) == (1..));
|
||||
assert!(test(FullRange) == (FullRange));
|
||||
assert!(test(RangeFull) == (RangeFull));
|
||||
|
||||
// Check that ranges can still be used with non-clone limits
|
||||
assert!((Test(1)..Test(5)) == (Test(1)..Test(5)));
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#![feature(associated_types)]
|
||||
|
||||
extern crate core;
|
||||
use core::ops::{Index, IndexMut, Range, RangeTo, RangeFrom, FullRange};
|
||||
use core::ops::{Index, IndexMut, Range, RangeTo, RangeFrom, RangeFull};
|
||||
|
||||
static mut COUNT: uint = 0;
|
||||
|
||||
|
|
@ -40,9 +40,9 @@ impl Index<RangeFrom<Foo>> for Foo {
|
|||
self
|
||||
}
|
||||
}
|
||||
impl Index<FullRange> for Foo {
|
||||
impl Index<RangeFull> for Foo {
|
||||
type Output = Foo;
|
||||
fn index(&self, _index: &FullRange) -> &Foo {
|
||||
fn index(&self, _index: &RangeFull) -> &Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
|
|
@ -69,9 +69,9 @@ impl IndexMut<RangeFrom<Foo>> for Foo {
|
|||
self
|
||||
}
|
||||
}
|
||||
impl IndexMut<FullRange> for Foo {
|
||||
impl IndexMut<RangeFull> for Foo {
|
||||
type Output = Foo;
|
||||
fn index_mut(&mut self, _index: &FullRange) -> &mut Foo {
|
||||
fn index_mut(&mut self, _index: &RangeFull) -> &mut Foo {
|
||||
unsafe { COUNT += 1; }
|
||||
self
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue