register snapshot
This commit is contained in:
parent
f11f3e7bae
commit
a291a80fbe
@ -164,21 +164,6 @@ pub struct Bitv {
|
||||
nbits: uint
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
// FIXME(Gankro): NopeNopeNopeNopeNope (wait for IndexGet to be a thing)
|
||||
impl Index<uint,bool> for Bitv {
|
||||
#[inline]
|
||||
fn index(&self, i: &uint) -> &bool {
|
||||
if self.get(*i).expect("index out of bounds") {
|
||||
&TRUE
|
||||
} else {
|
||||
&FALSE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
// FIXME(Gankro): NopeNopeNopeNopeNope (wait for IndexGet to be a thing)
|
||||
impl Index<uint> for Bitv {
|
||||
type Output = bool;
|
||||
|
@ -877,18 +877,6 @@ impl<K: Show, V: Show> Show for BTreeMap<K, V> {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[stable]
|
||||
impl<K: Ord, Sized? Q, V> Index<Q, V> for BTreeMap<K, V>
|
||||
where Q: BorrowFrom<K> + Ord
|
||||
{
|
||||
fn index(&self, key: &Q) -> &V {
|
||||
self.get(key).expect("no entry found for key")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
#[stable]
|
||||
impl<K: Ord, Sized? Q, V> Index<Q> for BTreeMap<K, V>
|
||||
where Q: BorrowFrom<K> + Ord
|
||||
@ -900,18 +888,6 @@ impl<K: Ord, Sized? Q, V> Index<Q> for BTreeMap<K, V>
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[stable]
|
||||
impl<K: Ord, Sized? Q, V> IndexMut<Q, V> for BTreeMap<K, V>
|
||||
where Q: BorrowFrom<K> + Ord
|
||||
{
|
||||
fn index_mut(&mut self, key: &Q) -> &mut V {
|
||||
self.get_mut(key).expect("no entry found for key")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
#[stable]
|
||||
impl<K: Ord, Sized? Q, V> IndexMut<Q> for BTreeMap<K, V>
|
||||
where Q: BorrowFrom<K> + Ord
|
||||
|
@ -1360,17 +1360,6 @@ impl<S: Writer, A: Hash<S>> Hash<S> for RingBuf<A> {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[stable]
|
||||
impl<A> Index<uint, A> for RingBuf<A> {
|
||||
#[inline]
|
||||
fn index<'a>(&'a self, i: &uint) -> &'a A {
|
||||
self.get(*i).expect("Out of bounds access")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
#[stable]
|
||||
impl<A> Index<uint> for RingBuf<A> {
|
||||
type Output = A;
|
||||
@ -1381,17 +1370,6 @@ impl<A> Index<uint> for RingBuf<A> {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[stable]
|
||||
impl<A> IndexMut<uint, A> for RingBuf<A> {
|
||||
#[inline]
|
||||
fn index_mut<'a>(&'a mut self, i: &uint) -> &'a mut A {
|
||||
self.get_mut(*i).expect("Out of bounds access")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
#[stable]
|
||||
impl<A> IndexMut<uint> for RingBuf<A> {
|
||||
type Output = A;
|
||||
|
@ -1190,17 +1190,6 @@ impl<S: hash::Writer, T: Hash<S>> Hash<S> for Vec<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[experimental = "waiting on Index stability"]
|
||||
impl<T> Index<uint,T> for Vec<T> {
|
||||
#[inline]
|
||||
fn index<'a>(&'a self, index: &uint) -> &'a T {
|
||||
&self.as_slice()[*index]
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
#[experimental = "waiting on Index stability"]
|
||||
impl<T> Index<uint> for Vec<T> {
|
||||
type Output = T;
|
||||
@ -1211,16 +1200,6 @@ impl<T> Index<uint> for Vec<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
impl<T> IndexMut<uint,T> for Vec<T> {
|
||||
#[inline]
|
||||
fn index_mut<'a>(&'a mut self, index: &uint) -> &'a mut T {
|
||||
&mut self.as_mut_slice()[*index]
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
impl<T> IndexMut<uint> for Vec<T> {
|
||||
type Output = T;
|
||||
|
||||
|
@ -517,17 +517,6 @@ impl<V> Extend<(uint, V)> for VecMap<V> {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[stable]
|
||||
impl<V> Index<uint, V> for VecMap<V> {
|
||||
#[inline]
|
||||
fn index<'a>(&'a self, i: &uint) -> &'a V {
|
||||
self.get(i).expect("key not present")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
impl<V> Index<uint> for VecMap<V> {
|
||||
type Output = V;
|
||||
|
||||
@ -537,17 +526,6 @@ impl<V> Index<uint> for VecMap<V> {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[stable]
|
||||
impl<V> IndexMut<uint, V> for VecMap<V> {
|
||||
#[inline]
|
||||
fn index_mut<'a>(&'a mut self, i: &uint) -> &'a mut V {
|
||||
self.get_mut(i).expect("key not present")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
#[stable]
|
||||
impl<V> IndexMut<uint> for VecMap<V> {
|
||||
type Output = V;
|
||||
|
@ -717,15 +717,6 @@ macro_rules! shr_impl {
|
||||
|
||||
shr_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 }
|
||||
|
||||
// NOTE(stage0) remove trait after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[allow(missing_docs)]
|
||||
#[lang="index"]
|
||||
pub trait Index<Sized? Index, Sized? Result> for Sized? {
|
||||
/// The method for the indexing (`Foo[Bar]`) operation
|
||||
fn index<'a>(&'a self, index: &Index) -> &'a Result;
|
||||
}
|
||||
|
||||
/// The `Index` trait is used to specify the functionality of indexing operations
|
||||
/// like `arr[idx]` when used in an immutable context.
|
||||
///
|
||||
@ -755,7 +746,6 @@ pub trait Index<Sized? Index, Sized? Result> for Sized? {
|
||||
/// Foo[Foo];
|
||||
/// }
|
||||
/// ```
|
||||
#[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot
|
||||
#[lang="index"]
|
||||
pub trait Index<Sized? Index> for Sized? {
|
||||
type Sized? Output;
|
||||
@ -764,15 +754,6 @@ pub trait Index<Sized? Index> for Sized? {
|
||||
fn index<'a>(&'a self, index: &Index) -> &'a Self::Output;
|
||||
}
|
||||
|
||||
// NOTE(stage0) remove trait after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[allow(missing_docs)]
|
||||
#[lang="index_mut"]
|
||||
pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
|
||||
/// The method for the indexing (`Foo[Bar]`) operation
|
||||
fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result;
|
||||
}
|
||||
|
||||
/// The `IndexMut` trait is used to specify the functionality of indexing
|
||||
/// operations like `arr[idx]`, when used in a mutable context.
|
||||
///
|
||||
@ -802,7 +783,6 @@ pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
|
||||
/// &mut Foo[Foo];
|
||||
/// }
|
||||
/// ```
|
||||
#[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot
|
||||
#[lang="index_mut"]
|
||||
pub trait IndexMut<Sized? Index> for Sized? {
|
||||
type Sized? Output;
|
||||
|
@ -531,17 +531,6 @@ impl<T> SliceExt for [T] {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0) remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
impl<T> ops::Index<uint, T> for [T] {
|
||||
fn index(&self, &index: &uint) -> &T {
|
||||
assert!(index < self.len());
|
||||
|
||||
unsafe { mem::transmute(self.repr().data.offset(index as int)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot
|
||||
impl<T> ops::Index<uint> for [T] {
|
||||
type Output = T;
|
||||
|
||||
@ -552,17 +541,6 @@ impl<T> ops::Index<uint> for [T] {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0) remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
impl<T> ops::IndexMut<uint, T> for [T] {
|
||||
fn index_mut(&mut self, &index: &uint) -> &mut T {
|
||||
assert!(index < self.len());
|
||||
|
||||
unsafe { mem::transmute(self.repr().data.offset(index as int)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot
|
||||
impl<T> ops::IndexMut<uint> for [T] {
|
||||
type Output = T;
|
||||
|
||||
|
@ -1125,15 +1125,6 @@ impl Json {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
impl<'a> ops::Index<&'a str, Json> for Json {
|
||||
fn index(&self, idx: & &str) -> &Json {
|
||||
self.find(*idx).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
impl<'a> ops::Index<&'a str> for Json {
|
||||
type Output = Json;
|
||||
|
||||
@ -1142,18 +1133,6 @@ impl<'a> ops::Index<&'a str> for Json {
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
impl ops::Index<uint, Json> for Json {
|
||||
fn index<'a>(&'a self, idx: &uint) -> &'a Json {
|
||||
match self {
|
||||
&Json::Array(ref v) => v.index(idx),
|
||||
_ => panic!("can only index Json with uint if it is an array")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
impl ops::Index<uint> for Json {
|
||||
type Output = Json;
|
||||
|
||||
|
@ -1226,19 +1226,6 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S> + Default> Default for HashMap<K, V, H>
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[stable]
|
||||
impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> Index<Q, V> for HashMap<K, V, H>
|
||||
where Q: BorrowFrom<K> + Hash<S> + Eq
|
||||
{
|
||||
#[inline]
|
||||
fn index<'a>(&'a self, index: &Q) -> &'a V {
|
||||
self.get(index).expect("no entry found for key")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
#[stable]
|
||||
impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> Index<Q> for HashMap<K, V, H>
|
||||
where Q: BorrowFrom<K> + Hash<S> + Eq
|
||||
@ -1251,19 +1238,6 @@ impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> Index<Q> for HashMap<K, V, H
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[stable]
|
||||
impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> IndexMut<Q, V> for HashMap<K, V, H>
|
||||
where Q: BorrowFrom<K> + Hash<S> + Eq
|
||||
{
|
||||
#[inline]
|
||||
fn index_mut<'a>(&'a mut self, index: &Q) -> &'a mut V {
|
||||
self.get_mut(index).expect("no entry found for key")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
|
||||
#[stable]
|
||||
impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> IndexMut<Q> for HashMap<K, V, H>
|
||||
where Q: BorrowFrom<K> + Hash<S> + Eq
|
||||
|
@ -1,3 +1,12 @@
|
||||
S 2015-01-04 b2085d9
|
||||
freebsd-x86_64 50ccb6bf9c0645d0746a5167493a39b2be40c2d4
|
||||
linux-i386 b880b98d832c9a049b8ef6a50df50061e363de5a
|
||||
linux-x86_64 82a09c162474b69d2d1e4e8399086f3f0f4e31c3
|
||||
macos-i386 569055bb10d96ab25f78ecf2c80ffbccd5e69b8d
|
||||
macos-x86_64 cff1f9ebd63dae6890359b7d353bd9486d8ecdfc
|
||||
winnt-i386 553790fe493413287a19d17a42bf7225d3e2272d
|
||||
winnt-x86_64 bab0d13960afb7ccdd6bf11452de1b9c457cc3e9
|
||||
|
||||
S 2015-01-02 c894171
|
||||
freebsd-x86_64 ea8bcf75eada3539f5cbab51708eecf40d436b77
|
||||
linux-i386 646ae265721e3cbe19404aae4fea4ffa1f1d90cf
|
||||
|
Loading…
x
Reference in New Issue
Block a user