Skip to content

Commit eaf8820

Browse files
committed
---
yaml --- r: 212685 b: refs/heads/tmp c: ebc3de2 h: refs/heads/master i: 212683: 3172d6c v: v3
1 parent 53bef55 commit eaf8820

Some content is hidden

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

70 files changed

+145
-570
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 4efc4ec178f6ddf3c8cd268b011f3a04056f9d16
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: c95da07eb080278071079d9f75f45e2042b12f0b
35+
refs/heads/tmp: ebc3de22d8e3b7b1d6e2c77e444965bb9db51aa7
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: bea1c4a78e5233ea6f85a2028a26e08c26635fca
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
651651

652652
// Write debugger script:
653653
// We don't want to hang when calling `quit` while the process is still running
654-
let mut script_str = String::from("settings set auto-confirm true\n");
654+
let mut script_str = String::from_str("settings set auto-confirm true\n");
655655

656656
// Make LLDB emit its version, so we have it documented in the test output
657657
script_str.push_str("version\n");

branches/tmp/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ be undesired.
10381038

10391039
* Deadlocks
10401040
* Reading data from private fields (`std::repr`)
1041-
* Leaks of memory and other resources
1041+
* Leaks due to reference count cycles, even in the global heap
10421042
* Exiting without calling destructors
10431043
* Sending signals
10441044
* Accessing/modifying the file system

branches/tmp/src/doc/trpl/closures.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ let plus_two = |x| {
3333
assert_eq!(4, plus_two(2));
3434
```
3535

36-
You’ll notice a few things about closures that are a bit different from regular
37-
functions defined with `fn`. The first is that we did not need to
36+
You’ll notice a few things about closures that are a bit different than regular
37+
functions defined with `fn`. The first of which is that we did not need to
3838
annotate the types of arguments the closure takes or the values it returns. We
3939
can:
4040

@@ -48,18 +48,18 @@ But we don’t have to. Why is this? Basically, it was chosen for ergonomic reas
4848
While specifying the full type for named functions is helpful with things like
4949
documentation and type inference, the types of closures are rarely documented
5050
since they’re anonymous, and they don’t cause the kinds of error-at-a-distance
51-
problems that inferring named function types can.
51+
that inferring named function types can.
5252

5353
The second is that the syntax is similar, but a bit different. I’ve added spaces
54-
here for easier comparison:
54+
here to make them look a little closer:
5555

5656
```rust
5757
fn plus_one_v1 (x: i32) -> i32 { x + 1 }
5858
let plus_one_v2 = |x: i32| -> i32 { x + 1 };
5959
let plus_one_v3 = |x: i32| x + 1 ;
6060
```
6161

62-
Small differences, but they’re similar.
62+
Small differences, but they’re similar in ways.
6363

6464
# Closures and their environment
6565

@@ -99,7 +99,7 @@ note: previous borrow ends here
9999
fn main() {
100100
let mut num = 5;
101101
let plus_num = |x| x + num;
102-
102+
103103
let y = &mut num;
104104
}
105105
^
@@ -161,7 +161,7 @@ of `num`. So what’s the difference?
161161
```rust
162162
let mut num = 5;
163163

164-
{
164+
{
165165
let mut add_num = |x: i32| num += x;
166166

167167
add_num(5);
@@ -180,7 +180,7 @@ If we change to a `move` closure, it’s different:
180180
```rust
181181
let mut num = 5;
182182

183-
{
183+
{
184184
let mut add_num = move |x: i32| num += x;
185185

186186
add_num(5);

branches/tmp/src/doc/trpl/comments.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ The other kind of comment is a doc comment. Doc comments use `///` instead of
2929
/// let five = 5;
3030
///
3131
/// assert_eq!(6, add_one(5));
32-
/// # fn add_one(x: i32) -> i32 {
33-
/// # x + 1
34-
/// # }
3532
/// ```
3633
fn add_one(x: i32) -> i32 {
3734
x + 1

branches/tmp/src/doc/trpl/dining-philosophers.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,7 @@ an extra annotation, `move`, to indicate that the closure is going to take
432432
ownership of the values it’s capturing. Primarily, the `p` variable of the
433433
`map` function.
434434

435-
Inside the thread, all we do is call `eat()` on `p`. Also note that the call to `thread::spawn` lacks a trailing semicolon, making this an expression. This distinction is important, yielding the correct return value. For more details, read [Expressions vs. Statements][es].
436-
437-
[es]: functions.html#expressions-vs.-statements
435+
Inside the thread, all we do is call `eat()` on `p`.
438436

439437
```rust,ignore
440438
}).collect();

branches/tmp/src/doc/trpl/error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ struct Info {
284284
}
285285

286286
fn write_info(info: &Info) -> io::Result<()> {
287-
let mut file = File::create("my_best_friends.txt").unwrap();
287+
let mut file = try!(File::create("my_best_friends.txt"));
288288

289289
try!(writeln!(&mut file, "name: {}", info.name));
290290
try!(writeln!(&mut file, "age: {}", info.age));

branches/tmp/src/doc/trpl/ownership.md

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -156,46 +156,6 @@ that, just like a move, when we assign `v` to `v2`, a copy of the data is made.
156156
But, unlike a move, we can still use `v` afterward. This is because an `i32`
157157
has no pointers to data somewhere else, copying it is a full copy.
158158

159-
All primitive types implement the `Copy` trait and their ownership is
160-
therefore not moved like one would assume, following the ´ownership rules´.
161-
To give an example, the two following snippets of code only compile because the
162-
`i32` and `bool` types implement the `Copy` trait.
163-
164-
```rust
165-
fn main() {
166-
let a = 5;
167-
168-
let _y = double(a);
169-
println!("{}", a);
170-
}
171-
172-
fn double(x: i32) -> i32 {
173-
x * 2
174-
}
175-
```
176-
177-
```rust
178-
fn main() {
179-
let a = true;
180-
181-
let _y = change_truth(a);
182-
println!("{}", a);
183-
}
184-
185-
fn change_truth(x: bool) -> bool {
186-
!x
187-
}
188-
```
189-
190-
If we would have used types that do not implement the `Copy` trait,
191-
we would have gotten a compile error because we tried to use a moved value.
192-
193-
```text
194-
error: use of moved value: `a`
195-
println!("{}", a);
196-
^
197-
```
198-
199159
We will discuss how to make your own types `Copy` in the [traits][traits]
200160
section.
201161

branches/tmp/src/doc/trpl/trait-objects.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static Foo_for_String_vtable: FooVtable = FooVtable {
261261
```
262262

263263
The `destructor` field in each vtable points to a function that will clean up
264-
any resources of the vtable’s type: for `u8` it is trivial, but for `String` it
264+
any resources of the vtable’s type, for `u8` it is trivial, but for `String` it
265265
will free the memory. This is necessary for owning trait objects like
266266
`Box<Foo>`, which need to clean-up both the `Box` allocation as well as the
267267
internal type when they go out of scope. The `size` and `align` fields store
@@ -270,7 +270,7 @@ essentially unused at the moment since the information is embedded in the
270270
destructor, but will be used in the future, as trait objects are progressively
271271
made more flexible.
272272

273-
Suppose we’ve got some values that implement `Foo`. The explicit form of
273+
Suppose we’ve got some values that implement `Foo`, then the explicit form of
274274
construction and use of `Foo` trait objects might look a bit like (ignoring the
275275
type mismatches: they’re all just pointers anyway):
276276

branches/tmp/src/doc/trpl/traits.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ but we don’t define a body, just a type signature. When we `impl` a trait,
4545
we use `impl Trait for Item`, rather than just `impl Item`.
4646

4747
We can use traits to constrain our generics. Consider this function, which
48-
does not compile:
48+
does not compile, and gives us a similar error:
4949

5050
```rust,ignore
5151
fn print_area<T>(shape: T) {
@@ -56,7 +56,7 @@ fn print_area<T>(shape: T) {
5656
Rust complains:
5757

5858
```text
59-
error: no method named `area` found for type `T` in the current scope
59+
error: type `T` does not implement any method in scope named `area`
6060
```
6161

6262
Because `T` can be any type, we can’t be sure that it implements the `area`
@@ -212,10 +212,10 @@ This will compile without error.
212212
This means that even if someone does something bad like add methods to `i32`,
213213
it won’t affect you, unless you `use` that trait.
214214

215-
There’s one more restriction on implementing traits: either the trait, or the
216-
type you’re writing the `impl` for, must be defined by you. So, we could
215+
There’s one more restriction on implementing traits. Either the trait or the
216+
type you’re writing the `impl` for must be defined by you. So, we could
217217
implement the `HasArea` type for `i32`, because `HasArea` is in our code. But
218-
if we tried to implement `ToString`, a trait provided by Rust, for `i32`, we could
218+
if we tried to implement `Float`, a trait provided by Rust, for `i32`, we could
219219
not, because neither the trait nor the type are in our code.
220220

221221
One last thing about traits: generic functions with a trait bound use

branches/tmp/src/grammar/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ fn main() {
287287
let options = config::basic_options();
288288
let session = session::build_session(options, None,
289289
syntax::diagnostics::registry::Registry::new(&[]));
290-
let filemap = session.parse_sess.codemap().new_filemap(String::from("<n/a>"), code);
290+
let filemap = session.parse_sess.codemap().new_filemap(String::from_str("<n/a>"), code);
291291
let mut lexer = lexer::StringReader::new(session.diagnostic(), filemap);
292292
let cm = session.codemap();
293293

branches/tmp/src/libcollections/binary_heap.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -760,10 +760,3 @@ impl<T: Ord> Extend<T> for BinaryHeap<T> {
760760
}
761761
}
762762
}
763-
764-
#[stable(feature = "extend_ref", since = "1.2.0")]
765-
impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BinaryHeap<T> {
766-
fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
767-
self.extend(iter.into_iter().cloned());
768-
}
769-
}

branches/tmp/src/libcollections/bit.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,13 +1070,6 @@ impl Extend<bool> for BitVec {
10701070
}
10711071
}
10721072

1073-
#[stable(feature = "extend_ref", since = "1.2.0")]
1074-
impl<'a> Extend<&'a bool> for BitVec {
1075-
fn extend<I: IntoIterator<Item=&'a bool>>(&mut self, iter: I) {
1076-
self.extend(iter.into_iter().cloned());
1077-
}
1078-
}
1079-
10801073
#[stable(feature = "rust1", since = "1.0.0")]
10811074
impl Clone for BitVec {
10821075
#[inline]
@@ -1285,13 +1278,6 @@ impl Extend<usize> for BitSet {
12851278
}
12861279
}
12871280

1288-
#[stable(feature = "extend_ref", since = "1.2.0")]
1289-
impl<'a> Extend<&'a usize> for BitSet {
1290-
fn extend<I: IntoIterator<Item=&'a usize>>(&mut self, iter: I) {
1291-
self.extend(iter.into_iter().cloned());
1292-
}
1293-
}
1294-
12951281
#[stable(feature = "rust1", since = "1.0.0")]
12961282
impl PartialOrd for BitSet {
12971283
#[inline]

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -879,13 +879,6 @@ impl<K: Ord, V> Extend<(K, V)> for BTreeMap<K, V> {
879879
}
880880
}
881881

882-
#[stable(feature = "extend_ref", since = "1.2.0")]
883-
impl<'a, K: Ord + Copy, V: Copy> Extend<(&'a K, &'a V)> for BTreeMap<K, V> {
884-
fn extend<I: IntoIterator<Item=(&'a K, &'a V)>>(&mut self, iter: I) {
885-
self.extend(iter.into_iter().map(|(&key, &value)| (key, value)));
886-
}
887-
}
888-
889882
#[stable(feature = "rust1", since = "1.0.0")]
890883
impl<K: Hash, V: Hash> Hash for BTreeMap<K, V> {
891884
fn hash<H: Hasher>(&self, state: &mut H) {

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -509,13 +509,6 @@ impl<T: Ord> Extend<T> for BTreeSet<T> {
509509
}
510510
}
511511

512-
#[stable(feature = "extend_ref", since = "1.2.0")]
513-
impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BTreeSet<T> {
514-
fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
515-
self.extend(iter.into_iter().cloned());
516-
}
517-
}
518-
519512
#[stable(feature = "rust1", since = "1.0.0")]
520513
impl<T: Ord> Default for BTreeSet<T> {
521514
#[stable(feature = "rust1", since = "1.0.0")]

branches/tmp/src/libcollections/enum_set.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,3 @@ impl<E:CLike> Extend<E> for EnumSet<E> {
288288
}
289289
}
290290
}
291-
292-
#[stable(feature = "extend_ref", since = "1.2.0")]
293-
impl<'a, E: 'a + CLike + Copy> Extend<&'a E> for EnumSet<E> {
294-
fn extend<I: IntoIterator<Item=&'a E>>(&mut self, iter: I) {
295-
self.extend(iter.into_iter().cloned());
296-
}
297-
}

branches/tmp/src/libcollections/linked_list.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -904,13 +904,6 @@ impl<A> Extend<A> for LinkedList<A> {
904904
}
905905
}
906906

907-
#[stable(feature = "extend_ref", since = "1.2.0")]
908-
impl<'a, T: 'a + Copy> Extend<&'a T> for LinkedList<T> {
909-
fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
910-
self.extend(iter.into_iter().cloned());
911-
}
912-
}
913-
914907
#[stable(feature = "rust1", since = "1.0.0")]
915908
impl<A: PartialEq> PartialEq for LinkedList<A> {
916909
fn eq(&self, other: &LinkedList<A>) -> bool {

branches/tmp/src/libcollections/string.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ impl String {
8989
///
9090
/// ```
9191
/// # #![feature(collections)]
92-
/// let s = String::from("hello");
92+
/// let s = String::from_str("hello");
9393
/// assert_eq!(&s[..], "hello");
9494
/// ```
9595
#[inline]
96-
#[unstable(feature = "collections", reason = "use `String::from` instead")]
97-
#[deprecated(since = "1.2.0", reason = "use `String::from` instead")]
96+
#[unstable(feature = "collections",
97+
reason = "needs investigation to see if to_string() can match perf")]
9898
#[cfg(not(test))]
9999
pub fn from_str(string: &str) -> String {
100100
String { vec: <[_]>::to_vec(string.as_bytes()) }
@@ -793,13 +793,6 @@ impl Extend<char> for String {
793793
}
794794
}
795795

796-
#[stable(feature = "extend_ref", since = "1.2.0")]
797-
impl<'a> Extend<&'a char> for String {
798-
fn extend<I: IntoIterator<Item=&'a char>>(&mut self, iter: I) {
799-
self.extend(iter.into_iter().cloned());
800-
}
801-
}
802-
803796
#[stable(feature = "rust1", since = "1.0.0")]
804797
impl<'a> Extend<&'a str> for String {
805798
fn extend<I: IntoIterator<Item=&'a str>>(&mut self, iterable: I) {
@@ -1009,7 +1002,7 @@ pub fn as_string<'a>(x: &'a str) -> DerefString<'a> {
10091002
DerefString { x: as_vec(x.as_bytes()) }
10101003
}
10111004

1012-
/// Error returned from `String::from`
1005+
/// Error returned from `String::from_str`
10131006
#[unstable(feature = "str_parse_error", reason = "may want to be replaced with \
10141007
Void if it ever exists")]
10151008
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
@@ -1020,7 +1013,7 @@ impl FromStr for String {
10201013
type Err = ParseError;
10211014
#[inline]
10221015
fn from_str(s: &str) -> Result<String, ParseError> {
1023-
Ok(String::from(s))
1016+
Ok(String::from_str(s))
10241017
}
10251018
}
10261019

branches/tmp/src/libcollections/vec.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,13 +1578,6 @@ impl<T> Extend<T> for Vec<T> {
15781578
}
15791579
}
15801580

1581-
#[stable(feature = "extend_ref", since = "1.2.0")]
1582-
impl<'a, T: 'a + Copy> Extend<&'a T> for Vec<T> {
1583-
fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
1584-
self.extend(iter.into_iter().cloned());
1585-
}
1586-
}
1587-
15881581
__impl_slice_eq1! { Vec<A>, Vec<B> }
15891582
__impl_slice_eq1! { Vec<A>, &'b [B] }
15901583
__impl_slice_eq1! { Vec<A>, &'b mut [B] }

branches/tmp/src/libcollections/vec_deque.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,13 +1785,6 @@ impl<A> Extend<A> for VecDeque<A> {
17851785
}
17861786
}
17871787

1788-
#[stable(feature = "extend_ref", since = "1.2.0")]
1789-
impl<'a, T: 'a + Copy> Extend<&'a T> for VecDeque<T> {
1790-
fn extend<I: IntoIterator<Item=&'a T>>(&mut self, iter: I) {
1791-
self.extend(iter.into_iter().cloned());
1792-
}
1793-
}
1794-
17951788
#[stable(feature = "rust1", since = "1.0.0")]
17961789
impl<T: fmt::Debug> fmt::Debug for VecDeque<T> {
17971790
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

0 commit comments

Comments
 (0)