Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 12 pull requests #36953

Merged
merged 33 commits into from
Oct 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
06a7dcd
std: Correct stability attributes for some implementations
ollie27 Sep 28, 2016
99aae9b
Improve error message and snippet for "did you mean `x`"
gavinb Sep 28, 2016
a638580
fix typos
GuillaumeGomez Oct 2, 2016
bcac486
Avoid introducing `run` twice
BlueSpaceCanary Sep 30, 2016
159b8c4
Update unstable attr to reference tracking issue.
frewsxcv Oct 3, 2016
c3bc905
Remove redundant 'Type' in variant names, stop reexporting.
frewsxcv Oct 1, 2016
0d0f1b4
Rename method 'to_string' to match conventions.
frewsxcv Oct 1, 2016
6d08949
Migrate `VariantKind` construction function to associated function.
frewsxcv Oct 1, 2016
a400ccc
Cleanup `return` statements.
frewsxcv Oct 1, 2016
5b9ba4c
Remove redundant 'Import' in variant names, stop reexporting.
frewsxcv Oct 1, 2016
b55468c
Simplify equality checks.
frewsxcv Oct 2, 2016
88d4144
Migrate `VariantKind` constructor to `Clean` impl.
frewsxcv Oct 2, 2016
35d214a
Remove redundant 'Variant' in variant names, stop reexporting.
frewsxcv Oct 3, 2016
1fece3d
Optimize plug_leaks.
nnethercote Sep 29, 2016
3779971
Optimize plug_leaks some more.
nnethercote Sep 30, 2016
49960ad
Streamline StringReader::bump.
nnethercote Oct 3, 2016
9e3dcb4
Simplify `start_bpos` calculation in scan_comment().
nnethercote Oct 3, 2016
baa854f
Add missing urls for error module
GuillaumeGomez Oct 3, 2016
4935343
Check for overflow in Cursor<Vec<u8>>::write.
tmiasko Sep 30, 2016
d8ddef0
Add test for Issue #21837
Oct 3, 2016
7857903
Fix an ICE in BuildReducedGraphVisitor::visit_trait_item.
nnethercote Oct 4, 2016
5a4ecb4
Rollup merge of #36798 - gavinb:fix/36164, r=GuillaumeGomez
Manishearth Oct 4, 2016
e39a78a
Rollup merge of #36878 - BlueSpaceCanary:book-dedup-cargo-run-intro, …
Manishearth Oct 4, 2016
d25aeb0
Rollup merge of #36902 - ollie27:stab_impls, r=alexcrichton
Manishearth Oct 4, 2016
825e6b3
Rollup merge of #36903 - frewsxcv:typekind, r=jseyfried
Manishearth Oct 4, 2016
268521f
Rollup merge of #36908 - GuillaumeGomez:default_doc, r=apasel422
Manishearth Oct 4, 2016
4541249
Rollup merge of #36916 - frewsxcv:patch-1, r=alexcrichton
Manishearth Oct 4, 2016
ad76358
Rollup merge of #36917 - nnethercote:speed-up-plug_leaks, r=eddyb
Manishearth Oct 4, 2016
5c55db9
Rollup merge of #36921 - nnethercote:two-lexer-tweaks, r=nrc
Manishearth Oct 4, 2016
05e412a
Rollup merge of #36928 - GuillaumeGomez:error_urls, r=steveklabnik
Manishearth Oct 4, 2016
1f90368
Rollup merge of #36938 - tmiasko:cursor-seek-overflow, r=alexcrichton
Manishearth Oct 4, 2016
0e3cd4e
Rollup merge of #36941 - martinhath:issue-21837, r=alexcrichton
Manishearth Oct 4, 2016
177aabd
Rollup merge of #36951 - nnethercote:fix-ICE, r=eddyb
Manishearth Oct 4, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/doc/book/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ $ cargo run
Hello, world!
```

The `run` command comes in handy when you need to rapidly iterate on a
project.

Notice that this example didn’t re-build the project. Cargo figured out that
the file hasn’t changed, and so it just ran the binary. If you'd modified your
source code, Cargo would have rebuilt the project before running it, and you
Expand Down
9 changes: 3 additions & 6 deletions src/doc/book/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ $ cargo build
Excellent! Open up your `src/main.rs` again. We’ll be writing all of
our code in this file.

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

```bash
$ cargo run
Expand All @@ -67,9 +65,8 @@ $ cargo run
Hello, world!
```

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

# Processing a Guess

Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ pub struct Drain<'a, T: 'a> {
iter: vec::Drain<'a, T>,
}

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

Expand All @@ -1048,15 +1048,15 @@ impl<'a, T: 'a> Iterator for Drain<'a, T> {
}
}

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

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

#[unstable(feature = "fused", issue = "35602")]
Expand Down
35 changes: 35 additions & 0 deletions src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ pub struct BTreeMap<K, V> {
length: usize,
}

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

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

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

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

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

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

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

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

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

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

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

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

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

#[stable(feature = "rust1", since = "1.0.0")]
impl<K, V> IntoIterator for BTreeMap<K, V> {
type Item = (K, V);
type IntoIter = IntoIter<K, V>;
Expand All @@ -1244,6 +1256,7 @@ impl<K, V> IntoIterator for BTreeMap<K, V> {
}
}

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

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

Expand Down Expand Up @@ -1304,6 +1318,7 @@ impl<K, V> Iterator for IntoIter<K, V> {
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#[stable(feature = "rust1", since = "1.0.0")]
impl<K: Ord, V> Default for BTreeMap<K, V> {
/// Creates an empty `BTreeMap<K, V>`.
fn default() -> BTreeMap<K, V> {
BTreeMap::new()
}
}

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

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

#[stable(feature = "rust1", since = "1.0.0")]
impl<K: PartialOrd, V: PartialOrd> PartialOrd for BTreeMap<K, V> {
#[inline]
fn partial_cmp(&self, other: &BTreeMap<K, V>) -> Option<Ordering> {
self.iter().partial_cmp(other.iter())
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<K: Ord, V: Ord> Ord for BTreeMap<K, V> {
#[inline]
fn cmp(&self, other: &BTreeMap<K, V>) -> Ordering {
self.iter().cmp(other.iter())
}
}

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

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, K: Ord, Q: ?Sized, V> Index<&'a Q> for BTreeMap<K, V>
where K: Borrow<Q>,
Q: Ord
Expand Down
5 changes: 5 additions & 0 deletions src/libcollections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ impl<T: Debug> Debug for BTreeSet<T> {
}
}

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

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

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

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

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> Clone for Union<'a, T> {
fn clone(&self) -> Union<'a, T> {
Union {
Expand Down
3 changes: 0 additions & 3 deletions src/libcollections/enum_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ impl<E> Clone for EnumSet<E> {
}
}

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

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

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