Skip to content

Commit fa0be22

Browse files
author
Jake Shadle
committed
---
yaml --- r: 233812 b: refs/heads/beta c: 10d3873 h: refs/heads/master v: v3
1 parent 3508ffd commit fa0be22

File tree

56 files changed

+289
-976
lines changed

Some content is hidden

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

56 files changed

+289
-976
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: d50352419eedf95f40dc317c7d5a7fc586189e05
26+
refs/heads/beta: 10d3873fb5669982577117882cf0c021d627eda3
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ Read ["Installing Rust"] from [The Book].
7272
$ pacman -S base-devel
7373
```
7474
75+
> ***Note:*** If the package install fails during retrieval, you may need to update
76+
> `pacman`'s mirrors before attempting to install the `mingw64` toolchain. An example
77+
> of the symptom of this problem would be...
78+
79+
> ```sh
80+
> error: failed retrieving file 'mingw-w64-x86_64-libiconv-1.14-4-any.pkg.tar.xz'
81+
> from downloads.sourceforge.net : The requested URL returned error: 404
82+
> ```
83+
84+
> To update the mirrors for pacman, simply run the following commands in your
85+
> MSYS2 terminal and retry installing the `mingw64` toolchain.
86+
87+
> ```sh
88+
> $ pacman -Sy&&pacman -S pacman-mirrors
89+
> ```
90+
7591
3. Run `mingw32_shell.bat` or `mingw64_shell.bat` from wherever you installed
7692
MSYS2 (i.e. `C:\msys`), depending on whether you want 32-bit or 64-bit Rust.
7793

branches/beta/src/doc/trpl/ffi.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,11 +496,9 @@ strings are not terminated with `\0`. If you need a NUL-terminated string for
496496
interoperability with C, you should use the `CString` type in the `std::ffi`
497497
module.
498498

499-
The [`libc` crate on crates.io][libc] includes type aliases and function
500-
definitions for the C standard library in the `libc` module, and Rust links
501-
against `libc` and `libm` by default.
502-
503-
[libc]: https://crates.io/crates/libc
499+
The standard library includes type aliases and function definitions for the C
500+
standard library in the `libc` module, and Rust links against `libc` and `libm`
501+
by default.
504502

505503
# The "nullable pointer optimization"
506504

branches/beta/src/doc/trpl/testing.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,26 +120,13 @@ And that's reflected in the summary line:
120120
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured
121121
```
122122

123-
We also get a non-zero status code. We can use `$?` on OS X and Linux:
123+
We also get a non-zero status code:
124124

125125
```bash
126126
$ echo $?
127127
101
128128
```
129129

130-
On Windows, if you’re using `cmd`:
131-
132-
```bash
133-
> echo %ERRORLEVEL%
134-
```
135-
136-
And if you’re using PowerShell:
137-
138-
```bash
139-
> echo $LASTEXITCODE # the code itself
140-
> echo $? # a boolean, fail or succeed
141-
```
142-
143130
This is useful if you want to integrate `cargo test` into other tooling.
144131

145132
We can invert our test's failure with another attribute: `should_panic`:

branches/beta/src/libcollections/btree/map.rs

Lines changed: 9 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
459459
}
460460
});
461461
match result {
462-
Finished(ret) => return ret.map(|(_, v)| v),
462+
Finished(ret) => return ret,
463463
Continue(new_stack) => stack = new_stack
464464
}
465465
}
@@ -693,16 +693,16 @@ mod stack {
693693
impl<'a, K, V> SearchStack<'a, K, V, handle::KV, handle::Leaf> {
694694
/// Removes the key and value in the top element of the stack, then handles underflows as
695695
/// described in BTree's pop function.
696-
fn remove_leaf(mut self) -> (K, V) {
696+
fn remove_leaf(mut self) -> V {
697697
self.map.length -= 1;
698698

699699
// Remove the key-value pair from the leaf that this search stack points to.
700700
// Then, note if the leaf is underfull, and promptly forget the leaf and its ptr
701701
// to avoid ownership issues.
702-
let (key_val, mut underflow) = unsafe {
703-
let key_val = self.top.from_raw_mut().remove_as_leaf();
702+
let (value, mut underflow) = unsafe {
703+
let (_, value) = self.top.from_raw_mut().remove_as_leaf();
704704
let underflow = self.top.from_raw().node().is_underfull();
705-
(key_val, underflow)
705+
(value, underflow)
706706
};
707707

708708
loop {
@@ -717,7 +717,7 @@ mod stack {
717717
self.map.depth -= 1;
718718
self.map.root.hoist_lone_child();
719719
}
720-
return key_val;
720+
return value;
721721
}
722722
Some(mut handle) => {
723723
if underflow {
@@ -728,7 +728,7 @@ mod stack {
728728
}
729729
} else {
730730
// All done!
731-
return key_val;
731+
return value;
732732
}
733733
}
734734
}
@@ -739,7 +739,7 @@ mod stack {
739739
impl<'a, K, V> SearchStack<'a, K, V, handle::KV, handle::LeafOrInternal> {
740740
/// Removes the key and value in the top element of the stack, then handles underflows as
741741
/// described in BTree's pop function.
742-
pub fn remove(self) -> (K, V) {
742+
pub fn remove(self) -> V {
743743
// Ensure that the search stack goes to a leaf. This is necessary to perform deletion
744744
// in a BTree. Note that this may put the tree in an inconsistent state (further
745745
// described in into_leaf's comments), but this is immediately fixed by the
@@ -1208,7 +1208,7 @@ impl<'a, K: Ord, V> OccupiedEntry<'a, K, V> {
12081208
/// Takes the value of the entry out of the map, and returns it.
12091209
#[stable(feature = "rust1", since = "1.0.0")]
12101210
pub fn remove(self) -> V {
1211-
self.stack.remove().1
1211+
self.stack.remove()
12121212
}
12131213
}
12141214

@@ -1609,86 +1609,3 @@ impl<K: Ord, V> BTreeMap<K, V> {
16091609
}
16101610
}
16111611
}
1612-
1613-
impl<K, Q: ?Sized> super::Recover<Q> for BTreeMap<K, ()> where K: Borrow<Q> + Ord, Q: Ord {
1614-
type Key = K;
1615-
1616-
fn get(&self, key: &Q) -> Option<&K> {
1617-
let mut cur_node = &self.root;
1618-
loop {
1619-
match Node::search(cur_node, key) {
1620-
Found(handle) => return Some(handle.into_kv().0),
1621-
GoDown(handle) => match handle.force() {
1622-
Leaf(_) => return None,
1623-
Internal(internal_handle) => {
1624-
cur_node = internal_handle.into_edge();
1625-
continue;
1626-
}
1627-
}
1628-
}
1629-
}
1630-
}
1631-
1632-
fn take(&mut self, key: &Q) -> Option<K> {
1633-
// See `remove` for an explanation of this.
1634-
1635-
let mut stack = stack::PartialSearchStack::new(self);
1636-
loop {
1637-
let result = stack.with(move |pusher, node| {
1638-
match Node::search(node, key) {
1639-
Found(handle) => {
1640-
// Perfect match. Terminate the stack here, and remove the entry
1641-
Finished(Some(pusher.seal(handle).remove()))
1642-
},
1643-
GoDown(handle) => {
1644-
// We need to keep searching, try to go down the next edge
1645-
match handle.force() {
1646-
// We're at a leaf; the key isn't in here
1647-
Leaf(_) => Finished(None),
1648-
Internal(internal_handle) => Continue(pusher.push(internal_handle))
1649-
}
1650-
}
1651-
}
1652-
});
1653-
match result {
1654-
Finished(ret) => return ret.map(|(k, _)| k),
1655-
Continue(new_stack) => stack = new_stack
1656-
}
1657-
}
1658-
}
1659-
1660-
fn replace(&mut self, mut key: K) -> Option<K> {
1661-
// See `insert` for an explanation of this.
1662-
1663-
let mut stack = stack::PartialSearchStack::new(self);
1664-
1665-
loop {
1666-
let result = stack.with(move |pusher, node| {
1667-
match Node::search::<K, _>(node, &key) {
1668-
Found(mut handle) => {
1669-
mem::swap(handle.key_mut(), &mut key);
1670-
Finished(Some(key))
1671-
},
1672-
GoDown(handle) => {
1673-
match handle.force() {
1674-
Leaf(leaf_handle) => {
1675-
pusher.seal(leaf_handle).insert(key, ());
1676-
Finished(None)
1677-
}
1678-
Internal(internal_handle) => {
1679-
Continue((pusher.push(internal_handle), key, ()))
1680-
}
1681-
}
1682-
}
1683-
}
1684-
});
1685-
match result {
1686-
Finished(ret) => return ret,
1687-
Continue((new_stack, renewed_key, _)) => {
1688-
stack = new_stack;
1689-
key = renewed_key;
1690-
}
1691-
}
1692-
}
1693-
}
1694-
}

branches/beta/src/libcollections/btree/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,3 @@
1111
mod node;
1212
pub mod map;
1313
pub mod set;
14-
15-
trait Recover<Q: ?Sized> {
16-
type Key;
17-
18-
fn get(&self, key: &Q) -> Option<&Self::Key>;
19-
fn take(&mut self, key: &Q) -> Option<Self::Key>;
20-
fn replace(&mut self, key: Self::Key) -> Option<Self::Key>;
21-
}

branches/beta/src/libcollections/btree/set.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use core::ops::{BitOr, BitAnd, BitXor, Sub};
1919

2020
use borrow::Borrow;
2121
use btree_map::{BTreeMap, Keys};
22-
use super::Recover;
2322
use Bound;
2423

2524
// FIXME(conventions): implement bounded iterators
@@ -330,16 +329,6 @@ impl<T: Ord> BTreeSet<T> {
330329
self.map.contains_key(value)
331330
}
332331

333-
/// Returns a reference to the value in the set, if any, that is equal to the given value.
334-
///
335-
/// The value may be any borrowed form of the set's value type,
336-
/// but the ordering on the borrowed form *must* match the
337-
/// ordering on the value type.
338-
#[unstable(feature = "set_recovery", issue = "28050")]
339-
pub fn get<Q: ?Sized>(&self, value: &Q) -> Option<&T> where T: Borrow<Q>, Q: Ord {
340-
Recover::get(&self.map, value)
341-
}
342-
343332
/// Returns `true` if the set has no elements in common with `other`.
344333
/// This is equivalent to checking for an empty intersection.
345334
///
@@ -447,13 +436,6 @@ impl<T: Ord> BTreeSet<T> {
447436
self.map.insert(value, ()).is_none()
448437
}
449438

450-
/// Adds a value to the set, replacing the existing value, if any, that is equal to the given
451-
/// one. Returns the replaced value.
452-
#[unstable(feature = "set_recovery", issue = "28050")]
453-
pub fn replace(&mut self, value: T) -> Option<T> {
454-
Recover::replace(&mut self.map, value)
455-
}
456-
457439
/// Removes a value from the set. Returns `true` if the value was
458440
/// present in the set.
459441
///
@@ -476,16 +458,6 @@ impl<T: Ord> BTreeSet<T> {
476458
pub fn remove<Q: ?Sized>(&mut self, value: &Q) -> bool where T: Borrow<Q>, Q: Ord {
477459
self.map.remove(value).is_some()
478460
}
479-
480-
/// Removes and returns the value in the set, if any, that is equal to the given one.
481-
///
482-
/// The value may be any borrowed form of the set's value type,
483-
/// but the ordering on the borrowed form *must* match the
484-
/// ordering on the value type.
485-
#[unstable(feature = "set_recovery", issue = "28050")]
486-
pub fn take<Q: ?Sized>(&mut self, value: &Q) -> Option<T> where T: Borrow<Q>, Q: Ord {
487-
Recover::take(&mut self.map, value)
488-
}
489461
}
490462

491463
#[stable(feature = "rust1", since = "1.0.0")]

branches/beta/src/libcollections/fmt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ pub use core::fmt::{LowerHex, UpperHex, Pointer};
481481
pub use core::fmt::{LowerExp, UpperExp};
482482
pub use core::fmt::Error;
483483
pub use core::fmt::{ArgumentV1, Arguments, write, radix, Radix, RadixFmt};
484-
pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
485484

486485
use string;
487486

branches/beta/src/libcollections/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ mod std {
113113
}
114114

115115
/// An endpoint of a range of keys.
116-
#[unstable(feature = "collections_bound", issue = "27787")]
116+
#[unstable(feature = "collections_bound", issue = "27711")]
117117
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
118118
pub enum Bound<T> {
119119
/// An inclusive bound.

branches/beta/src/libcollections/string.rs

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,7 @@ impl String {
734734
///
735735
/// Note that this will drop any excess capacity.
736736
#[unstable(feature = "box_str",
737-
reason = "recently added, matches RFC",
738-
issue = "27785")]
737+
reason = "recently added, matches RFC")]
739738
#[deprecated(since = "1.4.0", reason = "renamed to `into_boxed_str`")]
740739
pub fn into_boxed_slice(self) -> Box<str> {
741740
self.into_boxed_str()
@@ -769,27 +768,18 @@ impl fmt::Display for FromUtf16Error {
769768

770769
#[stable(feature = "rust1", since = "1.0.0")]
771770
impl FromIterator<char> for String {
772-
fn from_iter<I: IntoIterator<Item=char>>(iterable: I) -> String {
771+
fn from_iter<I: IntoIterator<Item=char>>(iter: I) -> String {
773772
let mut buf = String::new();
774-
buf.extend(iterable);
773+
buf.extend(iter);
775774
buf
776775
}
777776
}
778777

779778
#[stable(feature = "rust1", since = "1.0.0")]
780779
impl<'a> FromIterator<&'a str> for String {
781-
fn from_iter<I: IntoIterator<Item=&'a str>>(iterable: I) -> String {
782-
let mut buf = String::new();
783-
buf.extend(iterable);
784-
buf
785-
}
786-
}
787-
788-
#[stable(feature = "extend_string", since = "1.4.0")]
789-
impl FromIterator<String> for String {
790-
fn from_iter<I: IntoIterator<Item=String>>(iterable: I) -> String {
780+
fn from_iter<I: IntoIterator<Item=&'a str>>(iter: I) -> String {
791781
let mut buf = String::new();
792-
buf.extend(iterable);
782+
buf.extend(iter);
793783
buf
794784
}
795785
}
@@ -808,8 +798,8 @@ impl Extend<char> for String {
808798

809799
#[stable(feature = "extend_ref", since = "1.2.0")]
810800
impl<'a> Extend<&'a char> for String {
811-
fn extend<I: IntoIterator<Item=&'a char>>(&mut self, iterable: I) {
812-
self.extend(iterable.into_iter().cloned());
801+
fn extend<I: IntoIterator<Item=&'a char>>(&mut self, iter: I) {
802+
self.extend(iter.into_iter().cloned());
813803
}
814804
}
815805

@@ -822,15 +812,6 @@ impl<'a> Extend<&'a str> for String {
822812
}
823813
}
824814

825-
#[stable(feature = "extend_string", since = "1.4.0")]
826-
impl Extend<String> for String {
827-
fn extend<I: IntoIterator<Item=String>>(&mut self, iterable: I) {
828-
for s in iterable {
829-
self.push_str(&s)
830-
}
831-
}
832-
}
833-
834815
/// A convenience impl that delegates to the impl for `&str`
835816
impl<'a, 'b> Pattern<'a> for &'b String {
836817
type Searcher = <&'b str as Pattern<'a>>::Searcher;

0 commit comments

Comments
 (0)