Skip to content

Commit 4a9af01

Browse files
authored
Auto merge of #36953 - Manishearth:rollup, r=Manishearth
Rollup of 12 pull requests - Successful merges: #36798, #36878, #36902, #36903, #36908, #36916, #36917, #36921, #36928, #36938, #36941, #36951 - Failed merges:
2 parents 5ea241b + 177aabd commit 4a9af01

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+354
-227
lines changed

src/doc/book/getting-started.md

+3
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ $ cargo run
505505
Hello, world!
506506
```
507507

508+
The `run` command comes in handy when you need to rapidly iterate on a
509+
project.
510+
508511
Notice that this example didn’t re-build the project. Cargo figured out that
509512
the file hasn’t changed, and so it just ran the binary. If you'd modified your
510513
source code, Cargo would have rebuilt the project before running it, and you

src/doc/book/guessing-game.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ $ cargo build
5656
Excellent! Open up your `src/main.rs` again. We’ll be writing all of
5757
our code in this file.
5858

59-
Before we move on, let me show you one more Cargo command: `run`. `cargo run`
60-
is kind of like `cargo build`, but it also then runs the produced executable.
61-
Try it out:
59+
Remember the `run` command from last chapter? Try it out again here:
6260

6361
```bash
6462
$ cargo run
@@ -67,9 +65,8 @@ $ cargo run
6765
Hello, world!
6866
```
6967

70-
Great! The `run` command comes in handy when you need to rapidly iterate on a
71-
project. Our game is such a project, we need to quickly test each
72-
iteration before moving on to the next one.
68+
Great! Our game is just the kind of project `run` is good for: we need
69+
to quickly test each iteration before moving on to the next one.
7370

7471
# Processing a Guess
7572

src/libcollections/binary_heap.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ pub struct Drain<'a, T: 'a> {
10331033
iter: vec::Drain<'a, T>,
10341034
}
10351035

1036-
#[stable(feature = "rust1", since = "1.0.0")]
1036+
#[stable(feature = "drain", since = "1.6.0")]
10371037
impl<'a, T: 'a> Iterator for Drain<'a, T> {
10381038
type Item = T;
10391039

@@ -1048,15 +1048,15 @@ impl<'a, T: 'a> Iterator for Drain<'a, T> {
10481048
}
10491049
}
10501050

1051-
#[stable(feature = "rust1", since = "1.0.0")]
1051+
#[stable(feature = "drain", since = "1.6.0")]
10521052
impl<'a, T: 'a> DoubleEndedIterator for Drain<'a, T> {
10531053
#[inline]
10541054
fn next_back(&mut self) -> Option<T> {
10551055
self.iter.next_back()
10561056
}
10571057
}
10581058

1059-
#[stable(feature = "rust1", since = "1.0.0")]
1059+
#[stable(feature = "drain", since = "1.6.0")]
10601060
impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {}
10611061

10621062
#[unstable(feature = "fused", issue = "35602")]

src/libcollections/btree/map.rs

+35
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ pub struct BTreeMap<K, V> {
136136
length: usize,
137137
}
138138

139+
#[stable(feature = "btree_drop", since = "1.7.0")]
139140
impl<K, V> Drop for BTreeMap<K, V> {
140141
#[unsafe_destructor_blind_to_params]
141142
fn drop(&mut self) {
@@ -146,6 +147,7 @@ impl<K, V> Drop for BTreeMap<K, V> {
146147
}
147148
}
148149

150+
#[stable(feature = "rust1", since = "1.0.0")]
149151
impl<K: Clone, V: Clone> Clone for BTreeMap<K, V> {
150152
fn clone(&self) -> BTreeMap<K, V> {
151153
fn clone_subtree<K: Clone, V: Clone>(node: node::NodeRef<marker::Immut,
@@ -1125,6 +1127,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
11251127
}
11261128
}
11271129

1130+
#[stable(feature = "rust1", since = "1.0.0")]
11281131
impl<'a, K: 'a, V: 'a> IntoIterator for &'a BTreeMap<K, V> {
11291132
type Item = (&'a K, &'a V);
11301133
type IntoIter = Iter<'a, K, V>;
@@ -1134,6 +1137,7 @@ impl<'a, K: 'a, V: 'a> IntoIterator for &'a BTreeMap<K, V> {
11341137
}
11351138
}
11361139

1140+
#[stable(feature = "rust1", since = "1.0.0")]
11371141
impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> {
11381142
type Item = (&'a K, &'a V);
11391143

@@ -1154,6 +1158,7 @@ impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> {
11541158
#[unstable(feature = "fused", issue = "35602")]
11551159
impl<'a, K, V> FusedIterator for Iter<'a, K, V> {}
11561160

1161+
#[stable(feature = "rust1", since = "1.0.0")]
11571162
impl<'a, K: 'a, V: 'a> DoubleEndedIterator for Iter<'a, K, V> {
11581163
fn next_back(&mut self) -> Option<(&'a K, &'a V)> {
11591164
if self.length == 0 {
@@ -1165,12 +1170,14 @@ impl<'a, K: 'a, V: 'a> DoubleEndedIterator for Iter<'a, K, V> {
11651170
}
11661171
}
11671172

1173+
#[stable(feature = "rust1", since = "1.0.0")]
11681174
impl<'a, K: 'a, V: 'a> ExactSizeIterator for Iter<'a, K, V> {
11691175
fn len(&self) -> usize {
11701176
self.length
11711177
}
11721178
}
11731179

1180+
#[stable(feature = "rust1", since = "1.0.0")]
11741181
impl<'a, K, V> Clone for Iter<'a, K, V> {
11751182
fn clone(&self) -> Iter<'a, K, V> {
11761183
Iter {
@@ -1180,6 +1187,7 @@ impl<'a, K, V> Clone for Iter<'a, K, V> {
11801187
}
11811188
}
11821189

1190+
#[stable(feature = "rust1", since = "1.0.0")]
11831191
impl<'a, K: 'a, V: 'a> IntoIterator for &'a mut BTreeMap<K, V> {
11841192
type Item = (&'a K, &'a mut V);
11851193
type IntoIter = IterMut<'a, K, V>;
@@ -1189,6 +1197,7 @@ impl<'a, K: 'a, V: 'a> IntoIterator for &'a mut BTreeMap<K, V> {
11891197
}
11901198
}
11911199

1200+
#[stable(feature = "rust1", since = "1.0.0")]
11921201
impl<'a, K: 'a, V: 'a> Iterator for IterMut<'a, K, V> {
11931202
type Item = (&'a K, &'a mut V);
11941203

@@ -1206,6 +1215,7 @@ impl<'a, K: 'a, V: 'a> Iterator for IterMut<'a, K, V> {
12061215
}
12071216
}
12081217

1218+
#[stable(feature = "rust1", since = "1.0.0")]
12091219
impl<'a, K: 'a, V: 'a> DoubleEndedIterator for IterMut<'a, K, V> {
12101220
fn next_back(&mut self) -> Option<(&'a K, &'a mut V)> {
12111221
if self.length == 0 {
@@ -1217,6 +1227,7 @@ impl<'a, K: 'a, V: 'a> DoubleEndedIterator for IterMut<'a, K, V> {
12171227
}
12181228
}
12191229

1230+
#[stable(feature = "rust1", since = "1.0.0")]
12201231
impl<'a, K: 'a, V: 'a> ExactSizeIterator for IterMut<'a, K, V> {
12211232
fn len(&self) -> usize {
12221233
self.length
@@ -1226,6 +1237,7 @@ impl<'a, K: 'a, V: 'a> ExactSizeIterator for IterMut<'a, K, V> {
12261237
#[unstable(feature = "fused", issue = "35602")]
12271238
impl<'a, K, V> FusedIterator for IterMut<'a, K, V> {}
12281239

1240+
#[stable(feature = "rust1", since = "1.0.0")]
12291241
impl<K, V> IntoIterator for BTreeMap<K, V> {
12301242
type Item = (K, V);
12311243
type IntoIter = IntoIter<K, V>;
@@ -1244,6 +1256,7 @@ impl<K, V> IntoIterator for BTreeMap<K, V> {
12441256
}
12451257
}
12461258

1259+
#[stable(feature = "btree_drop", since = "1.7.0")]
12471260
impl<K, V> Drop for IntoIter<K, V> {
12481261
fn drop(&mut self) {
12491262
for _ in &mut *self {
@@ -1260,6 +1273,7 @@ impl<K, V> Drop for IntoIter<K, V> {
12601273
}
12611274
}
12621275

1276+
#[stable(feature = "rust1", since = "1.0.0")]
12631277
impl<K, V> Iterator for IntoIter<K, V> {
12641278
type Item = (K, V);
12651279

@@ -1304,6 +1318,7 @@ impl<K, V> Iterator for IntoIter<K, V> {
13041318
}
13051319
}
13061320

1321+
#[stable(feature = "rust1", since = "1.0.0")]
13071322
impl<K, V> DoubleEndedIterator for IntoIter<K, V> {
13081323
fn next_back(&mut self) -> Option<(K, V)> {
13091324
if self.length == 0 {
@@ -1342,6 +1357,7 @@ impl<K, V> DoubleEndedIterator for IntoIter<K, V> {
13421357
}
13431358
}
13441359

1360+
#[stable(feature = "rust1", since = "1.0.0")]
13451361
impl<K, V> ExactSizeIterator for IntoIter<K, V> {
13461362
fn len(&self) -> usize {
13471363
self.length
@@ -1351,6 +1367,7 @@ impl<K, V> ExactSizeIterator for IntoIter<K, V> {
13511367
#[unstable(feature = "fused", issue = "35602")]
13521368
impl<K, V> FusedIterator for IntoIter<K, V> {}
13531369

1370+
#[stable(feature = "rust1", since = "1.0.0")]
13541371
impl<'a, K, V> Iterator for Keys<'a, K, V> {
13551372
type Item = &'a K;
13561373

@@ -1363,12 +1380,14 @@ impl<'a, K, V> Iterator for Keys<'a, K, V> {
13631380
}
13641381
}
13651382

1383+
#[stable(feature = "rust1", since = "1.0.0")]
13661384
impl<'a, K, V> DoubleEndedIterator for Keys<'a, K, V> {
13671385
fn next_back(&mut self) -> Option<&'a K> {
13681386
self.inner.next_back().map(|(k, _)| k)
13691387
}
13701388
}
13711389

1390+
#[stable(feature = "rust1", since = "1.0.0")]
13721391
impl<'a, K, V> ExactSizeIterator for Keys<'a, K, V> {
13731392
fn len(&self) -> usize {
13741393
self.inner.len()
@@ -1378,12 +1397,14 @@ impl<'a, K, V> ExactSizeIterator for Keys<'a, K, V> {
13781397
#[unstable(feature = "fused", issue = "35602")]
13791398
impl<'a, K, V> FusedIterator for Keys<'a, K, V> {}
13801399

1400+
#[stable(feature = "rust1", since = "1.0.0")]
13811401
impl<'a, K, V> Clone for Keys<'a, K, V> {
13821402
fn clone(&self) -> Keys<'a, K, V> {
13831403
Keys { inner: self.inner.clone() }
13841404
}
13851405
}
13861406

1407+
#[stable(feature = "rust1", since = "1.0.0")]
13871408
impl<'a, K, V> Iterator for Values<'a, K, V> {
13881409
type Item = &'a V;
13891410

@@ -1396,12 +1417,14 @@ impl<'a, K, V> Iterator for Values<'a, K, V> {
13961417
}
13971418
}
13981419

1420+
#[stable(feature = "rust1", since = "1.0.0")]
13991421
impl<'a, K, V> DoubleEndedIterator for Values<'a, K, V> {
14001422
fn next_back(&mut self) -> Option<&'a V> {
14011423
self.inner.next_back().map(|(_, v)| v)
14021424
}
14031425
}
14041426

1427+
#[stable(feature = "rust1", since = "1.0.0")]
14051428
impl<'a, K, V> ExactSizeIterator for Values<'a, K, V> {
14061429
fn len(&self) -> usize {
14071430
self.inner.len()
@@ -1411,6 +1434,7 @@ impl<'a, K, V> ExactSizeIterator for Values<'a, K, V> {
14111434
#[unstable(feature = "fused", issue = "35602")]
14121435
impl<'a, K, V> FusedIterator for Values<'a, K, V> {}
14131436

1437+
#[stable(feature = "rust1", since = "1.0.0")]
14141438
impl<'a, K, V> Clone for Values<'a, K, V> {
14151439
fn clone(&self) -> Values<'a, K, V> {
14161440
Values { inner: self.inner.clone() }
@@ -1635,6 +1659,7 @@ impl<'a, K, V> RangeMut<'a, K, V> {
16351659
}
16361660
}
16371661

1662+
#[stable(feature = "rust1", since = "1.0.0")]
16381663
impl<K: Ord, V> FromIterator<(K, V)> for BTreeMap<K, V> {
16391664
fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> BTreeMap<K, V> {
16401665
let mut map = BTreeMap::new();
@@ -1643,6 +1668,7 @@ impl<K: Ord, V> FromIterator<(K, V)> for BTreeMap<K, V> {
16431668
}
16441669
}
16451670

1671+
#[stable(feature = "rust1", since = "1.0.0")]
16461672
impl<K: Ord, V> Extend<(K, V)> for BTreeMap<K, V> {
16471673
#[inline]
16481674
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T) {
@@ -1652,12 +1678,14 @@ impl<K: Ord, V> Extend<(K, V)> for BTreeMap<K, V> {
16521678
}
16531679
}
16541680

1681+
#[stable(feature = "extend_ref", since = "1.2.0")]
16551682
impl<'a, K: Ord + Copy, V: Copy> Extend<(&'a K, &'a V)> for BTreeMap<K, V> {
16561683
fn extend<I: IntoIterator<Item = (&'a K, &'a V)>>(&mut self, iter: I) {
16571684
self.extend(iter.into_iter().map(|(&key, &value)| (key, value)));
16581685
}
16591686
}
16601687

1688+
#[stable(feature = "rust1", since = "1.0.0")]
16611689
impl<K: Hash, V: Hash> Hash for BTreeMap<K, V> {
16621690
fn hash<H: Hasher>(&self, state: &mut H) {
16631691
for elt in self {
@@ -1666,41 +1694,48 @@ impl<K: Hash, V: Hash> Hash for BTreeMap<K, V> {
16661694
}
16671695
}
16681696

1697+
#[stable(feature = "rust1", since = "1.0.0")]
16691698
impl<K: Ord, V> Default for BTreeMap<K, V> {
16701699
/// Creates an empty `BTreeMap<K, V>`.
16711700
fn default() -> BTreeMap<K, V> {
16721701
BTreeMap::new()
16731702
}
16741703
}
16751704

1705+
#[stable(feature = "rust1", since = "1.0.0")]
16761706
impl<K: PartialEq, V: PartialEq> PartialEq for BTreeMap<K, V> {
16771707
fn eq(&self, other: &BTreeMap<K, V>) -> bool {
16781708
self.len() == other.len() && self.iter().zip(other).all(|(a, b)| a == b)
16791709
}
16801710
}
16811711

1712+
#[stable(feature = "rust1", since = "1.0.0")]
16821713
impl<K: Eq, V: Eq> Eq for BTreeMap<K, V> {}
16831714

1715+
#[stable(feature = "rust1", since = "1.0.0")]
16841716
impl<K: PartialOrd, V: PartialOrd> PartialOrd for BTreeMap<K, V> {
16851717
#[inline]
16861718
fn partial_cmp(&self, other: &BTreeMap<K, V>) -> Option<Ordering> {
16871719
self.iter().partial_cmp(other.iter())
16881720
}
16891721
}
16901722

1723+
#[stable(feature = "rust1", since = "1.0.0")]
16911724
impl<K: Ord, V: Ord> Ord for BTreeMap<K, V> {
16921725
#[inline]
16931726
fn cmp(&self, other: &BTreeMap<K, V>) -> Ordering {
16941727
self.iter().cmp(other.iter())
16951728
}
16961729
}
16971730

1731+
#[stable(feature = "rust1", since = "1.0.0")]
16981732
impl<K: Debug, V: Debug> Debug for BTreeMap<K, V> {
16991733
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17001734
f.debug_map().entries(self.iter()).finish()
17011735
}
17021736
}
17031737

1738+
#[stable(feature = "rust1", since = "1.0.0")]
17041739
impl<'a, K: Ord, Q: ?Sized, V> Index<&'a Q> for BTreeMap<K, V>
17051740
where K: Borrow<Q>,
17061741
Q: Ord

src/libcollections/btree/set.rs

+5
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,7 @@ impl<T: Debug> Debug for BTreeSet<T> {
779779
}
780780
}
781781

782+
#[stable(feature = "rust1", since = "1.0.0")]
782783
impl<'a, T> Clone for Iter<'a, T> {
783784
fn clone(&self) -> Iter<'a, T> {
784785
Iter { iter: self.iter.clone() }
@@ -864,6 +865,7 @@ fn cmp_opt<T: Ord>(x: Option<&T>, y: Option<&T>, short: Ordering, long: Ordering
864865
}
865866
}
866867

868+
#[stable(feature = "rust1", since = "1.0.0")]
867869
impl<'a, T> Clone for Difference<'a, T> {
868870
fn clone(&self) -> Difference<'a, T> {
869871
Difference {
@@ -901,6 +903,7 @@ impl<'a, T: Ord> Iterator for Difference<'a, T> {
901903
#[unstable(feature = "fused", issue = "35602")]
902904
impl<'a, T: Ord> FusedIterator for Difference<'a, T> {}
903905

906+
#[stable(feature = "rust1", since = "1.0.0")]
904907
impl<'a, T> Clone for SymmetricDifference<'a, T> {
905908
fn clone(&self) -> SymmetricDifference<'a, T> {
906909
SymmetricDifference {
@@ -934,6 +937,7 @@ impl<'a, T: Ord> Iterator for SymmetricDifference<'a, T> {
934937
#[unstable(feature = "fused", issue = "35602")]
935938
impl<'a, T: Ord> FusedIterator for SymmetricDifference<'a, T> {}
936939

940+
#[stable(feature = "rust1", since = "1.0.0")]
937941
impl<'a, T> Clone for Intersection<'a, T> {
938942
fn clone(&self) -> Intersection<'a, T> {
939943
Intersection {
@@ -977,6 +981,7 @@ impl<'a, T: Ord> Iterator for Intersection<'a, T> {
977981
#[unstable(feature = "fused", issue = "35602")]
978982
impl<'a, T: Ord> FusedIterator for Intersection<'a, T> {}
979983

984+
#[stable(feature = "rust1", since = "1.0.0")]
980985
impl<'a, T> Clone for Union<'a, T> {
981986
fn clone(&self) -> Union<'a, T> {
982987
Union {

src/libcollections/enum_set.rs

-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ impl<E> Clone for EnumSet<E> {
4848
}
4949
}
5050

51-
#[stable(feature = "rust1", since = "1.0.0")]
5251
impl<E: CLike + fmt::Debug> fmt::Debug for EnumSet<E> {
5352
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
5453
fmt.debug_set().entries(self).finish()
@@ -277,7 +276,6 @@ impl<E: CLike> FromIterator<E> for EnumSet<E> {
277276
}
278277
}
279278

280-
#[stable(feature = "rust1", since = "1.0.0")]
281279
impl<'a, E> IntoIterator for &'a EnumSet<E> where E: CLike
282280
{
283281
type Item = E;
@@ -296,7 +294,6 @@ impl<E: CLike> Extend<E> for EnumSet<E> {
296294
}
297295
}
298296

299-
#[stable(feature = "extend_ref", since = "1.2.0")]
300297
impl<'a, E: 'a + CLike + Copy> Extend<&'a E> for EnumSet<E> {
301298
fn extend<I: IntoIterator<Item = &'a E>>(&mut self, iter: I) {
302299
self.extend(iter.into_iter().cloned());

0 commit comments

Comments
 (0)