impl Index<usize> for BitVec {
type Output = bool;
+
+ #[cfg(stage0)]
#[inline]
fn index(&self, i: &usize) -> &bool {
if self.get(*i).expect("index out of bounds") {
&FALSE
}
}
+
+ #[cfg(not(stage0))]
+ #[inline]
+ fn index(&self, i: usize) -> &bool {
+ if self.get(i).expect("index out of bounds") {
+ &TRUE
+ } else {
+ &FALSE
+ }
+ }
}
/// Computes how many blocks are needed to store that many bits
type Output: ?Sized;
/// The method for the indexing (`Foo[Bar]`) operation
+ #[cfg(stage0)]
#[stable(feature = "rust1", since = "1.0.0")]
fn index<'a>(&'a self, index: &Idx) -> &'a Self::Output;
+
+ /// The method for the indexing (`Foo[Bar]`) operation
+ #[cfg(not(stage0))]
+ #[stable(feature = "rust1", since = "1.0.0")]
+ fn index<'a>(&'a self, index: Idx) -> &'a Self::Output;
}
/// The `IndexMut` trait is used to specify the functionality of indexing
#[stable(feature = "rust1", since = "1.0.0")]
pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
/// The method for the indexing (`Foo[Bar]`) operation
+ #[cfg(stage0)]
#[stable(feature = "rust1", since = "1.0.0")]
fn index_mut<'a>(&'a mut self, index: &Idx) -> &'a mut Self::Output;
+
+ /// The method for the indexing (`Foo[Bar]`) operation
+ #[cfg(not(stage0))]
+ #[stable(feature = "rust1", since = "1.0.0")]
+ fn index_mut<'a>(&'a mut self, index: Idx) -> &'a mut Self::Output;
}
/// An unbounded range.
base_datum,
vec![(ix_datum, idx.id)],
Some(SaveIn(scratch.val)),
- true));
+ false));
let datum = scratch.to_expr_datum();
if type_is_sized(bcx.tcx(), elt_ty) {
Datum::new(datum.to_llscalarish(bcx), elt_ty, LvalueExpr)