Skip to content

Commit 82b375b

Browse files
committed
Rollup merge of #23738 - alexcrichton:snapshots, r=cmr
2 parents 242ed0b + 36ef29a commit 82b375b

File tree

29 files changed

+25
-1166
lines changed

29 files changed

+25
-1166
lines changed

src/driver/driver.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#![cfg_attr(rustdoc, feature(rustdoc))]
1313

1414
#[cfg(rustdoc)]
15-
extern crate "rustdoc" as this;
15+
extern crate rustdoc as this;
1616

1717
#[cfg(rustc)]
18-
extern crate "rustc_driver" as this;
18+
extern crate rustc_driver as this;
1919

2020
fn main() { this::main() }

src/libcollections/bit.rs

-12
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,6 @@ pub struct BitVec {
171171
impl Index<usize> for BitVec {
172172
type Output = bool;
173173

174-
175-
#[cfg(stage0)]
176-
#[inline]
177-
fn index(&self, i: &usize) -> &bool {
178-
if self.get(*i).expect("index out of bounds") {
179-
&TRUE
180-
} else {
181-
&FALSE
182-
}
183-
}
184-
185-
#[cfg(not(stage0))]
186174
#[inline]
187175
fn index(&self, i: usize) -> &bool {
188176
if self.get(i).expect("index out of bounds") {

src/libcollections/btree/map.rs

-14
Original file line numberDiff line numberDiff line change
@@ -915,20 +915,6 @@ impl<K: Debug, V: Debug> Debug for BTreeMap<K, V> {
915915
}
916916
}
917917

918-
#[cfg(stage0)]
919-
#[stable(feature = "rust1", since = "1.0.0")]
920-
impl<K: Ord, Q: ?Sized, V> Index<Q> for BTreeMap<K, V>
921-
where K: Borrow<Q>, Q: Ord
922-
{
923-
type Output = V;
924-
925-
#[inline]
926-
fn index(&self, key: &Q) -> &V {
927-
self.get(key).expect("no entry found for key")
928-
}
929-
}
930-
931-
#[cfg(not(stage0))]
932918
#[stable(feature = "rust1", since = "1.0.0")]
933919
impl<'a, K: Ord, Q: ?Sized, V> Index<&'a Q> for BTreeMap<K, V>
934920
where K: Borrow<Q>, Q: Ord

src/libcollections/btree/node.rs

-61
Original file line numberDiff line numberDiff line change
@@ -1524,36 +1524,6 @@ macro_rules! node_slice_impl {
15241524
}
15251525

15261526
/// Returns a sub-slice with elements starting with `min_key`.
1527-
#[cfg(stage0)]
1528-
pub fn slice_from(self, min_key: &K) -> $NodeSlice<'a, K, V> {
1529-
// _______________
1530-
// |_1_|_3_|_5_|_7_|
1531-
// | | | | |
1532-
// 0 0 1 1 2 2 3 3 4 index
1533-
// | | | | |
1534-
// \___|___|___|___/ slice_from(&0); pos = 0
1535-
// \___|___|___/ slice_from(&2); pos = 1
1536-
// |___|___|___/ slice_from(&3); pos = 1; result.head_is_edge = false
1537-
// \___|___/ slice_from(&4); pos = 2
1538-
// \___/ slice_from(&6); pos = 3
1539-
// \|/ slice_from(&999); pos = 4
1540-
let (pos, pos_is_kv) = self.search_linear(min_key);
1541-
$NodeSlice {
1542-
has_edges: self.has_edges,
1543-
edges: if !self.has_edges {
1544-
self.edges
1545-
} else {
1546-
self.edges.$index(&(pos ..))
1547-
},
1548-
keys: &self.keys[pos ..],
1549-
vals: self.vals.$index(&(pos ..)),
1550-
head_is_edge: !pos_is_kv,
1551-
tail_is_edge: self.tail_is_edge,
1552-
}
1553-
}
1554-
1555-
/// Returns a sub-slice with elements starting with `min_key`.
1556-
#[cfg(not(stage0))]
15571527
pub fn slice_from(self, min_key: &K) -> $NodeSlice<'a, K, V> {
15581528
// _______________
15591529
// |_1_|_3_|_5_|_7_|
@@ -1582,37 +1552,6 @@ macro_rules! node_slice_impl {
15821552
}
15831553

15841554
/// Returns a sub-slice with elements up to and including `max_key`.
1585-
#[cfg(stage0)]
1586-
pub fn slice_to(self, max_key: &K) -> $NodeSlice<'a, K, V> {
1587-
// _______________
1588-
// |_1_|_3_|_5_|_7_|
1589-
// | | | | |
1590-
// 0 0 1 1 2 2 3 3 4 index
1591-
// | | | | |
1592-
//\|/ | | | | slice_to(&0); pos = 0
1593-
// \___/ | | | slice_to(&2); pos = 1
1594-
// \___|___| | | slice_to(&3); pos = 1; result.tail_is_edge = false
1595-
// \___|___/ | | slice_to(&4); pos = 2
1596-
// \___|___|___/ | slice_to(&6); pos = 3
1597-
// \___|___|___|___/ slice_to(&999); pos = 4
1598-
let (pos, pos_is_kv) = self.search_linear(max_key);
1599-
let pos = pos + if pos_is_kv { 1 } else { 0 };
1600-
$NodeSlice {
1601-
has_edges: self.has_edges,
1602-
edges: if !self.has_edges {
1603-
self.edges
1604-
} else {
1605-
self.edges.$index(&(.. (pos + 1)))
1606-
},
1607-
keys: &self.keys[..pos],
1608-
vals: self.vals.$index(&(.. pos)),
1609-
head_is_edge: self.head_is_edge,
1610-
tail_is_edge: !pos_is_kv,
1611-
}
1612-
}
1613-
1614-
/// Returns a sub-slice with elements up to and including `max_key`.
1615-
#[cfg(not(stage0))]
16161555
pub fn slice_to(self, max_key: &K) -> $NodeSlice<'a, K, V> {
16171556
// _______________
16181557
// |_1_|_3_|_5_|_7_|

src/libcollections/string.rs

-28
Original file line numberDiff line numberDiff line change
@@ -903,13 +903,6 @@ impl<'a> Add<&'a str> for String {
903903
impl ops::Index<ops::Range<usize>> for String {
904904
type Output = str;
905905

906-
#[cfg(stage0)]
907-
#[inline]
908-
fn index(&self, index: &ops::Range<usize>) -> &str {
909-
&self[..][*index]
910-
}
911-
912-
#[cfg(not(stage0))]
913906
#[inline]
914907
fn index(&self, index: ops::Range<usize>) -> &str {
915908
&self[..][index]
@@ -919,13 +912,6 @@ impl ops::Index<ops::Range<usize>> for String {
919912
impl ops::Index<ops::RangeTo<usize>> for String {
920913
type Output = str;
921914

922-
#[cfg(stage0)]
923-
#[inline]
924-
fn index(&self, index: &ops::RangeTo<usize>) -> &str {
925-
&self[..][*index]
926-
}
927-
928-
#[cfg(not(stage0))]
929915
#[inline]
930916
fn index(&self, index: ops::RangeTo<usize>) -> &str {
931917
&self[..][index]
@@ -935,13 +921,6 @@ impl ops::Index<ops::RangeTo<usize>> for String {
935921
impl ops::Index<ops::RangeFrom<usize>> for String {
936922
type Output = str;
937923

938-
#[cfg(stage0)]
939-
#[inline]
940-
fn index(&self, index: &ops::RangeFrom<usize>) -> &str {
941-
&self[..][*index]
942-
}
943-
944-
#[cfg(not(stage0))]
945924
#[inline]
946925
fn index(&self, index: ops::RangeFrom<usize>) -> &str {
947926
&self[..][index]
@@ -951,13 +930,6 @@ impl ops::Index<ops::RangeFrom<usize>> for String {
951930
impl ops::Index<ops::RangeFull> for String {
952931
type Output = str;
953932

954-
#[cfg(stage0)]
955-
#[inline]
956-
fn index(&self, _index: &ops::RangeFull) -> &str {
957-
unsafe { mem::transmute(&*self.vec) }
958-
}
959-
960-
#[cfg(not(stage0))]
961933
#[inline]
962934
fn index(&self, _index: ops::RangeFull) -> &str {
963935
unsafe { mem::transmute(&*self.vec) }

src/libcollections/vec.rs

-74
Original file line numberDiff line numberDiff line change
@@ -1343,15 +1343,6 @@ impl<T: Hash> Hash for Vec<T> {
13431343
impl<T> Index<usize> for Vec<T> {
13441344
type Output = T;
13451345

1346-
1347-
#[cfg(stage0)]
1348-
#[inline]
1349-
fn index(&self, index: &usize) -> &T {
1350-
// NB built-in indexing via `&[T]`
1351-
&(**self)[*index]
1352-
}
1353-
1354-
#[cfg(not(stage0))]
13551346
#[inline]
13561347
fn index(&self, index: usize) -> &T {
13571348
// NB built-in indexing via `&[T]`
@@ -1361,15 +1352,6 @@ impl<T> Index<usize> for Vec<T> {
13611352

13621353
#[stable(feature = "rust1", since = "1.0.0")]
13631354
impl<T> IndexMut<usize> for Vec<T> {
1364-
1365-
#[cfg(stage0)]
1366-
#[inline]
1367-
fn index_mut(&mut self, index: &usize) -> &mut T {
1368-
// NB built-in indexing via `&mut [T]`
1369-
&mut (**self)[*index]
1370-
}
1371-
1372-
#[cfg(not(stage0))]
13731355
#[inline]
13741356
fn index_mut(&mut self, index: usize) -> &mut T {
13751357
// NB built-in indexing via `&mut [T]`
@@ -1382,13 +1364,6 @@ impl<T> IndexMut<usize> for Vec<T> {
13821364
impl<T> ops::Index<ops::Range<usize>> for Vec<T> {
13831365
type Output = [T];
13841366

1385-
#[cfg(stage0)]
1386-
#[inline]
1387-
fn index(&self, index: &ops::Range<usize>) -> &[T] {
1388-
Index::index(&**self, index)
1389-
}
1390-
1391-
#[cfg(not(stage0))]
13921367
#[inline]
13931368
fn index(&self, index: ops::Range<usize>) -> &[T] {
13941369
Index::index(&**self, index)
@@ -1398,13 +1373,6 @@ impl<T> ops::Index<ops::Range<usize>> for Vec<T> {
13981373
impl<T> ops::Index<ops::RangeTo<usize>> for Vec<T> {
13991374
type Output = [T];
14001375

1401-
#[cfg(stage0)]
1402-
#[inline]
1403-
fn index(&self, index: &ops::RangeTo<usize>) -> &[T] {
1404-
Index::index(&**self, index)
1405-
}
1406-
1407-
#[cfg(not(stage0))]
14081376
#[inline]
14091377
fn index(&self, index: ops::RangeTo<usize>) -> &[T] {
14101378
Index::index(&**self, index)
@@ -1414,13 +1382,6 @@ impl<T> ops::Index<ops::RangeTo<usize>> for Vec<T> {
14141382
impl<T> ops::Index<ops::RangeFrom<usize>> for Vec<T> {
14151383
type Output = [T];
14161384

1417-
#[cfg(stage0)]
1418-
#[inline]
1419-
fn index(&self, index: &ops::RangeFrom<usize>) -> &[T] {
1420-
Index::index(&**self, index)
1421-
}
1422-
1423-
#[cfg(not(stage0))]
14241385
#[inline]
14251386
fn index(&self, index: ops::RangeFrom<usize>) -> &[T] {
14261387
Index::index(&**self, index)
@@ -1430,13 +1391,6 @@ impl<T> ops::Index<ops::RangeFrom<usize>> for Vec<T> {
14301391
impl<T> ops::Index<ops::RangeFull> for Vec<T> {
14311392
type Output = [T];
14321393

1433-
#[cfg(stage0)]
1434-
#[inline]
1435-
fn index(&self, _index: &ops::RangeFull) -> &[T] {
1436-
self
1437-
}
1438-
1439-
#[cfg(not(stage0))]
14401394
#[inline]
14411395
fn index(&self, _index: ops::RangeFull) -> &[T] {
14421396
self
@@ -1446,13 +1400,6 @@ impl<T> ops::Index<ops::RangeFull> for Vec<T> {
14461400
#[stable(feature = "rust1", since = "1.0.0")]
14471401
impl<T> ops::IndexMut<ops::Range<usize>> for Vec<T> {
14481402

1449-
#[cfg(stage0)]
1450-
#[inline]
1451-
fn index_mut(&mut self, index: &ops::Range<usize>) -> &mut [T] {
1452-
IndexMut::index_mut(&mut **self, index)
1453-
}
1454-
1455-
#[cfg(not(stage0))]
14561403
#[inline]
14571404
fn index_mut(&mut self, index: ops::Range<usize>) -> &mut [T] {
14581405
IndexMut::index_mut(&mut **self, index)
@@ -1461,13 +1408,6 @@ impl<T> ops::IndexMut<ops::Range<usize>> for Vec<T> {
14611408
#[stable(feature = "rust1", since = "1.0.0")]
14621409
impl<T> ops::IndexMut<ops::RangeTo<usize>> for Vec<T> {
14631410

1464-
#[cfg(stage0)]
1465-
#[inline]
1466-
fn index_mut(&mut self, index: &ops::RangeTo<usize>) -> &mut [T] {
1467-
IndexMut::index_mut(&mut **self, index)
1468-
}
1469-
1470-
#[cfg(not(stage0))]
14711411
#[inline]
14721412
fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut [T] {
14731413
IndexMut::index_mut(&mut **self, index)
@@ -1476,13 +1416,6 @@ impl<T> ops::IndexMut<ops::RangeTo<usize>> for Vec<T> {
14761416
#[stable(feature = "rust1", since = "1.0.0")]
14771417
impl<T> ops::IndexMut<ops::RangeFrom<usize>> for Vec<T> {
14781418

1479-
#[cfg(stage0)]
1480-
#[inline]
1481-
fn index_mut(&mut self, index: &ops::RangeFrom<usize>) -> &mut [T] {
1482-
IndexMut::index_mut(&mut **self, index)
1483-
}
1484-
1485-
#[cfg(not(stage0))]
14861419
#[inline]
14871420
fn index_mut(&mut self, index: ops::RangeFrom<usize>) -> &mut [T] {
14881421
IndexMut::index_mut(&mut **self, index)
@@ -1491,13 +1424,6 @@ impl<T> ops::IndexMut<ops::RangeFrom<usize>> for Vec<T> {
14911424
#[stable(feature = "rust1", since = "1.0.0")]
14921425
impl<T> ops::IndexMut<ops::RangeFull> for Vec<T> {
14931426

1494-
#[cfg(stage0)]
1495-
#[inline]
1496-
fn index_mut(&mut self, _index: &ops::RangeFull) -> &mut [T] {
1497-
self.as_mut_slice()
1498-
}
1499-
1500-
#[cfg(not(stage0))]
15011427
#[inline]
15021428
fn index_mut(&mut self, _index: ops::RangeFull) -> &mut [T] {
15031429
self.as_mut_slice()

src/libcollections/vec_deque.rs

-14
Original file line numberDiff line numberDiff line change
@@ -1705,13 +1705,6 @@ impl<A: Hash> Hash for VecDeque<A> {
17051705
impl<A> Index<usize> for VecDeque<A> {
17061706
type Output = A;
17071707

1708-
#[cfg(stage0)]
1709-
#[inline]
1710-
fn index(&self, i: &usize) -> &A {
1711-
self.get(*i).expect("Out of bounds access")
1712-
}
1713-
1714-
#[cfg(not(stage0))]
17151708
#[inline]
17161709
fn index(&self, i: usize) -> &A {
17171710
self.get(i).expect("Out of bounds access")
@@ -1720,13 +1713,6 @@ impl<A> Index<usize> for VecDeque<A> {
17201713

17211714
#[stable(feature = "rust1", since = "1.0.0")]
17221715
impl<A> IndexMut<usize> for VecDeque<A> {
1723-
#[cfg(stage0)]
1724-
#[inline]
1725-
fn index_mut(&mut self, i: &usize) -> &mut A {
1726-
self.get_mut(*i).expect("Out of bounds access")
1727-
}
1728-
1729-
#[cfg(not(stage0))]
17301716
#[inline]
17311717
fn index_mut(&mut self, i: usize) -> &mut A {
17321718
self.get_mut(i).expect("Out of bounds access")

0 commit comments

Comments
 (0)