diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 954de14a50a93..82b92d26d28bc 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -111,8 +111,9 @@ mod std { pub use core::option; // necessary for panic!() pub use core::clone; // derive(Clone) pub use core::cmp; // derive(Eq, Ord, etc.) - pub use core::marker; // derive(Copy) + pub use core::marker; // derive(Copy) pub use core::hash; // derive(Hash) + pub use core::ops; // RangeFull } #[cfg(test)] diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index ba1be09934fdd..56d969b89466c 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -98,7 +98,10 @@ use core::iter::{range_step, MultiplicativeIterator}; use core::marker::Sized; use core::mem::size_of; use core::mem; +#[cfg(stage0)] use core::ops::{FnMut, FullRange}; +#[cfg(not(stage0))] +use core::ops::FnMut; use core::option::Option::{self, Some, None}; use core::ptr::PtrExt; use core::ptr; @@ -1509,7 +1512,10 @@ mod tests { use core::prelude::{Some, None, range, Clone}; use core::prelude::{Iterator, IteratorExt}; use core::prelude::{AsSlice}; + #[cfg(stage0)] use core::prelude::{Ord, FullRange}; + #[cfg(not(stage0))] + use core::prelude::Ord; use core::default::Default; use core::mem; use std::iter::RandomAccessIterator; diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 5a1162b5c084a..35591a5e9effb 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -60,7 +60,13 @@ use core::char::CharExt; use core::clone::Clone; use core::iter::AdditiveIterator; use core::iter::{Iterator, IteratorExt}; -use core::ops::{FullRange, Index}; +use core::ops::Index; +#[cfg(stage0)] +use core::ops::FullRange as RangeFull; +#[cfg(stage0)] +use core::ops::FullRange; +#[cfg(not(stage0))] +use core::ops::RangeFull; use core::option::Option::{self, Some, None}; use core::slice::AsSlice; use core::str as core_str; @@ -408,7 +414,7 @@ Section: Trait implementations /// Any string that can be represented as a slice. #[stable(feature = "rust1", since = "1.0.0")] -pub trait StrExt: Index { +pub trait StrExt: Index { /// Escapes each char in `s` with `char::escape_default`. #[unstable(feature = "collections", reason = "return type may change to be an iterator")] diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 8f7920fe1c44b..035529c7365c8 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -877,6 +877,7 @@ impl ops::Index> for String { &self[][*index] } } +#[cfg(stage0)] #[stable(feature = "rust1", since = "1.0.0")] impl ops::Index for String { type Output = str; @@ -885,6 +886,15 @@ impl ops::Index for String { unsafe { mem::transmute(self.vec.as_slice()) } } } +#[cfg(not(stage0))] +#[stable(feature = "rust1", since = "1.0.0")] +impl ops::Index for String { + type Output = str; + #[inline] + fn index(&self, _index: &ops::RangeFull) -> &str { + unsafe { mem::transmute(self.vec.as_slice()) } + } +} #[stable(feature = "rust1", since = "1.0.0")] impl ops::Deref for String { @@ -995,6 +1005,7 @@ mod tests { use str::Utf8Error; use core::iter::repeat; use super::{as_string, CowString}; + #[cfg(stage0)] use core::ops::FullRange; #[test] diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 336a3d7521a19..5dd88dbb02524 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -1317,6 +1317,7 @@ impl ops::Index> for Vec { self.as_slice().index(index) } } +#[cfg(stage0)] #[stable(feature = "rust1", since = "1.0.0")] impl ops::Index for Vec { type Output = [T]; @@ -1325,6 +1326,15 @@ impl ops::Index for Vec { self.as_slice() } } +#[cfg(not(stage0))] +#[stable(feature = "rust1", since = "1.0.0")] +impl ops::Index for Vec { + type Output = [T]; + #[inline] + fn index(&self, _index: &ops::RangeFull) -> &[T] { + self.as_slice() + } +} #[stable(feature = "rust1", since = "1.0.0")] impl ops::IndexMut> for Vec { @@ -1350,6 +1360,7 @@ impl ops::IndexMut> for Vec { self.as_mut_slice().index_mut(index) } } +#[cfg(stage0)] #[stable(feature = "rust1", since = "1.0.0")] impl ops::IndexMut for Vec { type Output = [T]; @@ -1358,6 +1369,15 @@ impl ops::IndexMut for Vec { self.as_mut_slice() } } +#[cfg(not(stage0))] +#[stable(feature = "rust1", since = "1.0.0")] +impl ops::IndexMut for Vec { + type Output = [T]; + #[inline] + fn index_mut(&mut self, _index: &ops::RangeFull) -> &mut [T] { + self.as_mut_slice() + } +} #[stable(feature = "rust1", since = "1.0.0")] impl ops::Deref for Vec { @@ -1896,6 +1916,7 @@ mod tests { use prelude::*; use core::mem::size_of; use core::iter::repeat; + #[cfg(stage0)] use core::ops::FullRange; use test::Bencher; use super::as_vec; diff --git a/src/libcore/array.rs b/src/libcore/array.rs index 44541c34ee278..a81615944fb46 100644 --- a/src/libcore/array.rs +++ b/src/libcore/array.rs @@ -19,7 +19,10 @@ use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering}; use fmt; use hash::{Hash, Hasher, self}; use marker::Copy; +#[cfg(stage0)] use ops::{Deref, FullRange}; +#[cfg(not(stage0))] +use ops::Deref; use option::Option; // macro for implementing n-ary tuple functions and operations diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 81ce0610923e5..1032c56fa22ad 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -153,8 +153,9 @@ mod core { mod std { pub use clone; pub use cmp; - pub use marker; - pub use option; pub use fmt; pub use hash; + pub use marker; + pub use ops; + pub use option; } diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 55ff3eb4d062d..9e020eeb8a9c1 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -947,11 +947,20 @@ pub trait IndexMut { } /// An unbounded range. +#[cfg(stage0)] #[derive(Copy, Clone, PartialEq, Eq)] #[lang="full_range"] #[unstable(feature = "core", reason = "may be renamed to RangeFull")] pub struct FullRange; +/// An unbounded range. +#[cfg(not(stage0))] +#[derive(Copy, Clone, PartialEq, Eq)] +#[lang="range_full"] +#[stable(feature = "rust1", since = "1.0.0")] +pub struct RangeFull; + +#[cfg(stage0)] #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Debug for FullRange { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { @@ -959,6 +968,14 @@ impl fmt::Debug for FullRange { } } +#[cfg(not(stage0))] +#[stable(feature = "rust1", since = "1.0.0")] +impl fmt::Debug for RangeFull { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt::Debug::fmt("..", fmt) + } +} + /// A (half-open) range which is bounded at both ends. #[derive(Copy, Clone, PartialEq, Eq)] #[lang="range"] diff --git a/src/libcore/prelude.rs b/src/libcore/prelude.rs index da3f180d7e127..9d25317866493 100644 --- a/src/libcore/prelude.rs +++ b/src/libcore/prelude.rs @@ -26,7 +26,10 @@ // Reexported core operators pub use marker::{Copy, Send, Sized, Sync}; +#[cfg(stage0)] pub use ops::{Drop, Fn, FnMut, FnOnce, FullRange}; +#[cfg(not(stage0))] +pub use ops::{Drop, Fn, FnMut, FnOnce}; // Reexported functions pub use iter::range; diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index b1e9084d210f5..40e66db3ae5b0 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -44,6 +44,10 @@ use iter::*; use marker::Copy; use num::Int; use ops::{FnMut, self, Index}; +#[cfg(stage0)] +use ops::FullRange as RangeFull; +#[cfg(not(stage0))] +use ops::RangeFull; use option::Option; use option::Option::{None, Some}; use result::Result; @@ -543,10 +547,10 @@ impl ops::Index> for [T] { } } #[stable(feature = "rust1", since = "1.0.0")] -impl ops::Index for [T] { +impl ops::Index for [T] { type Output = [T]; #[inline] - fn index(&self, _index: &ops::FullRange) -> &[T] { + fn index(&self, _index: &RangeFull) -> &[T] { self } } @@ -584,10 +588,10 @@ impl ops::IndexMut> for [T] { } } #[stable(feature = "rust1", since = "1.0.0")] -impl ops::IndexMut for [T] { +impl ops::IndexMut for [T] { type Output = [T]; #[inline] - fn index_mut(&mut self, _index: &ops::FullRange) -> &mut [T] { + fn index_mut(&mut self, _index: &RangeFull) -> &mut [T] { self } } @@ -750,6 +754,7 @@ impl<'a, T> ops::Index> for Iter<'a, T> { } } +#[cfg(stage0)] #[unstable(feature = "core")] impl<'a, T> ops::Index for Iter<'a, T> { type Output = [T]; @@ -758,6 +763,15 @@ impl<'a, T> ops::Index for Iter<'a, T> { self.as_slice() } } +#[cfg(not(stage0))] +#[unstable(feature = "core")] +impl<'a, T> ops::Index for Iter<'a, T> { + type Output = [T]; + #[inline] + fn index(&self, _index: &RangeFull) -> &[T] { + self.as_slice() + } +} impl<'a, T> Iter<'a, T> { /// View the underlying data as a subslice of the original data. @@ -821,7 +835,7 @@ impl<'a, T> ops::Index> for IterMut<'a, T> { type Output = [T]; #[inline] fn index(&self, index: &ops::Range) -> &[T] { - self.index(&ops::FullRange).index(index) + self.index(&RangeFull).index(index) } } #[unstable(feature = "core")] @@ -829,7 +843,7 @@ impl<'a, T> ops::Index> for IterMut<'a, T> { type Output = [T]; #[inline] fn index(&self, index: &ops::RangeTo) -> &[T] { - self.index(&ops::FullRange).index(index) + self.index(&RangeFull).index(index) } } #[unstable(feature = "core")] @@ -837,14 +851,14 @@ impl<'a, T> ops::Index> for IterMut<'a, T> { type Output = [T]; #[inline] fn index(&self, index: &ops::RangeFrom) -> &[T] { - self.index(&ops::FullRange).index(index) + self.index(&RangeFull).index(index) } } #[unstable(feature = "core")] -impl<'a, T> ops::Index for IterMut<'a, T> { +impl<'a, T> ops::Index for IterMut<'a, T> { type Output = [T]; #[inline] - fn index(&self, _index: &ops::FullRange) -> &[T] { + fn index(&self, _index: &RangeFull) -> &[T] { make_slice!(T => &[T]: self.ptr, self.end) } } @@ -854,7 +868,7 @@ impl<'a, T> ops::IndexMut> for IterMut<'a, T> { type Output = [T]; #[inline] fn index_mut(&mut self, index: &ops::Range) -> &mut [T] { - self.index_mut(&ops::FullRange).index_mut(index) + self.index_mut(&RangeFull).index_mut(index) } } #[unstable(feature = "core")] @@ -862,7 +876,7 @@ impl<'a, T> ops::IndexMut> for IterMut<'a, T> { type Output = [T]; #[inline] fn index_mut(&mut self, index: &ops::RangeTo) -> &mut [T] { - self.index_mut(&ops::FullRange).index_mut(index) + self.index_mut(&RangeFull).index_mut(index) } } #[unstable(feature = "core")] @@ -870,14 +884,14 @@ impl<'a, T> ops::IndexMut> for IterMut<'a, T> { type Output = [T]; #[inline] fn index_mut(&mut self, index: &ops::RangeFrom) -> &mut [T] { - self.index_mut(&ops::FullRange).index_mut(index) + self.index_mut(&RangeFull).index_mut(index) } } #[unstable(feature = "core")] -impl<'a, T> ops::IndexMut for IterMut<'a, T> { +impl<'a, T> ops::IndexMut for IterMut<'a, T> { type Output = [T]; #[inline] - fn index_mut(&mut self, _index: &ops::FullRange) -> &mut [T] { + fn index_mut(&mut self, _index: &RangeFull) -> &mut [T] { make_slice!(T => &mut [T]: self.ptr, self.end) } } diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 228519656446c..8495a03747e7b 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1249,6 +1249,7 @@ mod traits { } } + #[cfg(stage0)] #[stable(feature = "rust1", since = "1.0.0")] impl ops::Index for str { type Output = str; @@ -1257,6 +1258,15 @@ mod traits { self } } + #[cfg(not(stage0))] + #[stable(feature = "rust1", since = "1.0.0")] + impl ops::Index for str { + type Output = str; + #[inline] + fn index(&self, _index: &ops::RangeFull) -> &str { + self + } + } } /// Any string that can be represented as a slice diff --git a/src/libcoretest/ops.rs b/src/libcoretest/ops.rs index 430188c7e4322..3da572f65a6a6 100644 --- a/src/libcoretest/ops.rs +++ b/src/libcoretest/ops.rs @@ -9,7 +9,7 @@ // except according to those terms. use test::Bencher; -use core::ops::{Range, FullRange, RangeFrom, RangeTo}; +use core::ops::{Range, RangeFull, RangeFrom, RangeTo}; // Overhead of dtors @@ -64,5 +64,5 @@ fn test_range_to() { #[test] fn test_full_range() { // Not much to test. - let _ = FullRange; + let _ = RangeFull; } diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index c1ce5945946c2..16d2c68ad60a9 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -269,7 +269,7 @@ lets_do_this! { RangeStructLangItem, "range", range_struct; RangeFromStructLangItem, "range_from", range_from_struct; RangeToStructLangItem, "range_to", range_to_struct; - FullRangeStructLangItem, "full_range", full_range_struct; + RangeFullStructLangItem, "range_full", range_full_struct; UnsafeTypeLangItem, "unsafe", unsafe_type; diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs index bd5acb9b2e890..2b97e7b79648a 100644 --- a/src/librustc_trans/trans/expr.rs +++ b/src/librustc_trans/trans/expr.rs @@ -1054,8 +1054,8 @@ fn trans_rvalue_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, (tcx.lang_items.range_to_struct(), fields, vec![node_id_type(bcx, end.id)]) } _ => { - // Desugar to FullRange - (tcx.lang_items.full_range_struct(), vec![], vec![]) + // Desugar to RangeFull + (tcx.lang_items.range_full_struct(), vec![], vec![]) } }; diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 1f04cab572a4b..d78b819065a99 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -4115,8 +4115,8 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>, } } None => { - // Neither start nor end => FullRange - if let Some(did) = tcx.lang_items.full_range_struct() { + // Neither start nor end => RangeFull + if let Some(did) = tcx.lang_items.range_full_struct() { let substs = Substs::new_type(vec![], vec![]); ty::mk_struct(tcx, did, tcx.mk_substs(substs)) } else { diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 8fdc5547e46b1..18e2aa8c098a7 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -82,6 +82,7 @@ impl OsString { } } +#[cfg(stage0)] impl ops::Index for OsString { type Output = OsStr; @@ -91,6 +92,16 @@ impl ops::Index for OsString { } } +#[cfg(not(stage0))] +impl ops::Index for OsString { + type Output = OsStr; + + #[inline] + fn index(&self, _index: &ops::RangeFull) -> &OsStr { + unsafe { mem::transmute(self.inner.as_slice()) } + } +} + impl ops::Deref for OsString { type Target = OsStr; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 3a745389e1e71..a016ba8fb0cd0 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -310,5 +310,4 @@ mod std { pub use slice; pub use boxed; // used for vec![] - } diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index b42353e964c51..b5409da9c9ca4 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -68,6 +68,7 @@ use fmt; use iter::IteratorExt; use option::Option; use option::Option::{None, Some}; +#[cfg(stage0)] use ops::FullRange; use str; use str::StrExt; diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index 2e6b9d50553fa..88db27013ac83 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -25,6 +25,7 @@ use iter::{AdditiveIterator, Extend}; use iter::{Iterator, IteratorExt, Map, repeat}; use mem; use option::Option::{self, Some, None}; +#[cfg(stage0)] use ops::FullRange; use slice::{SliceExt, SliceConcatExt}; use str::{SplitTerminator, FromStr, StrExt}; diff --git a/src/libstd/prelude/v1.rs b/src/libstd/prelude/v1.rs index 51c9f9de83cc8..b3c4ffa5120e8 100644 --- a/src/libstd/prelude/v1.rs +++ b/src/libstd/prelude/v1.rs @@ -18,7 +18,7 @@ #[stable(feature = "rust1", since = "1.0.0")] #[doc(no_inline)] pub use ops::{Drop, Fn, FnMut, FnOnce}; -// TEMPORARY +#[cfg(stage0)] #[unstable(feature = "std_misc")] #[doc(no_inline)] pub use ops::FullRange; diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index bc0721550634c..fdcb0c19f30af 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -680,6 +680,7 @@ impl ops::Index> for Wtf8 { } } +#[cfg(stage0)] impl ops::Index for Wtf8 { type Output = Wtf8; @@ -689,6 +690,16 @@ impl ops::Index for Wtf8 { } } +#[cfg(not(stage0))] +impl ops::Index for Wtf8 { + type Output = Wtf8; + + #[inline] + fn index(&self, _range: &ops::RangeFull) -> &Wtf8 { + self + } +} + #[inline] fn decode_surrogate(second_byte: u8, third_byte: u8) -> u16 { // The first byte is assumed to be 0xED diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 4c1ae532d13cd..c4224db8e18c3 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2527,14 +2527,27 @@ impl<'a> Parser<'a> { } if found_dotdot || self.eat(&token::CloseDelim(token::Bracket)) { - // No expression, expand to a FullRange + // No expression, expand to a RangeFull // FIXME(#20516) It would be better to use a lang item or - // something for FullRange. + // something for RangeFull. hi = self.last_span.hi; - let range = ExprStruct(ident_to_path(mk_sp(lo, hi), - token::special_idents::FullRange), - vec![], - None); + + let idents = vec![token::str_to_ident("std"), + token::str_to_ident("ops"), + token::str_to_ident("RangeFull")]; + let segments = idents.into_iter().map(|ident| { + ast::PathSegment { + identifier: ident, + parameters: ast::PathParameters::none(), + } + }).collect(); + let path = ast::Path { + span: mk_sp(lo, hi), + global: true, + segments: segments, + }; + + let range = ExprStruct(path, vec![], None); let ix = self.mk_expr(bracket_pos, hi, range); let index = self.mk_index(e, ix); e = self.mk_expr(lo, hi, index) diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 1ef33a2401e1b..5531ce7b119eb 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -516,66 +516,65 @@ declare_special_idents_and_keywords! { (9, unnamed_field, ""); (10, type_self, "Self"); (11, prelude_import, "prelude_import"); - (12, FullRange, "FullRange"); } pub mod keywords { // These ones are variants of the Keyword enum 'strict: - (13, As, "as"); - (14, Break, "break"); - (15, Crate, "crate"); - (16, Else, "else"); - (17, Enum, "enum"); - (18, Extern, "extern"); - (19, False, "false"); - (20, Fn, "fn"); - (21, For, "for"); - (22, If, "if"); - (23, Impl, "impl"); - (24, In, "in"); - (25, Let, "let"); - (26, Loop, "loop"); - (27, Match, "match"); - (28, Mod, "mod"); - (29, Move, "move"); - (30, Mut, "mut"); - (31, Pub, "pub"); - (32, Ref, "ref"); - (33, Return, "return"); + (12, As, "as"); + (13, Break, "break"); + (14, Crate, "crate"); + (15, Else, "else"); + (16, Enum, "enum"); + (17, Extern, "extern"); + (18, False, "false"); + (19, Fn, "fn"); + (20, For, "for"); + (21, If, "if"); + (22, Impl, "impl"); + (23, In, "in"); + (24, Let, "let"); + (25, Loop, "loop"); + (26, Match, "match"); + (27, Mod, "mod"); + (28, Move, "move"); + (29, Mut, "mut"); + (30, Pub, "pub"); + (31, Ref, "ref"); + (32, Return, "return"); // Static and Self are also special idents (prefill de-dupes) (super::STATIC_KEYWORD_NAME_NUM, Static, "static"); (super::SELF_KEYWORD_NAME_NUM, Self, "self"); - (34, Struct, "struct"); + (33, Struct, "struct"); (super::SUPER_KEYWORD_NAME_NUM, Super, "super"); - (35, True, "true"); - (36, Trait, "trait"); - (37, Type, "type"); - (38, Unsafe, "unsafe"); - (39, Use, "use"); - (40, Virtual, "virtual"); - (41, While, "while"); - (42, Continue, "continue"); - (43, Proc, "proc"); - (44, Box, "box"); - (45, Const, "const"); - (46, Where, "where"); + (34, True, "true"); + (35, Trait, "trait"); + (36, Type, "type"); + (37, Unsafe, "unsafe"); + (38, Use, "use"); + (39, Virtual, "virtual"); + (40, While, "while"); + (41, Continue, "continue"); + (42, Proc, "proc"); + (43, Box, "box"); + (44, Const, "const"); + (45, Where, "where"); 'reserved: - (47, Alignof, "alignof"); - (48, Be, "be"); - (49, Offsetof, "offsetof"); - (50, Priv, "priv"); - (51, Pure, "pure"); - (52, Sizeof, "sizeof"); - (53, Typeof, "typeof"); - (54, Unsized, "unsized"); - (55, Yield, "yield"); - (56, Do, "do"); - (57, Abstract, "abstract"); - (58, Final, "final"); - (59, Override, "override"); - (60, Macro, "macro"); + (46, Alignof, "alignof"); + (47, Be, "be"); + (48, Offsetof, "offsetof"); + (49, Priv, "priv"); + (50, Pure, "pure"); + (51, Sizeof, "sizeof"); + (52, Typeof, "typeof"); + (53, Unsized, "unsized"); + (54, Yield, "yield"); + (55, Do, "do"); + (56, Abstract, "abstract"); + (57, Final, "final"); + (58, Override, "override"); + (59, Macro, "macro"); } } diff --git a/src/test/run-pass/issue-21384.rs b/src/test/run-pass/issue-21384.rs index 0ec33d218f9a9..1d3984deac209 100644 --- a/src/test/run-pass/issue-21384.rs +++ b/src/test/run-pass/issue-21384.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use ::std::ops::RangeFull; + fn test(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))); diff --git a/src/test/run-pass/slice.rs b/src/test/run-pass/slice.rs index 9cb7cfd7fe98b..81db525db28a2 100644 --- a/src/test/run-pass/slice.rs +++ b/src/test/run-pass/slice.rs @@ -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> for Foo { self } } -impl Index for Foo { +impl Index 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> for Foo { self } } -impl IndexMut for Foo { +impl IndexMut 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 }