Skip to content

Commit 2f9f6d4

Browse files
committed
---
yaml --- r: 113064 b: refs/heads/try c: f072984 h: refs/heads/master v: v3
1 parent 81953d6 commit 2f9f6d4

File tree

115 files changed

+2031
-2412
lines changed

Some content is hidden

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

115 files changed

+2031
-2412
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: abdacecdf86b4b5a4f432560445a24e1c5f4751b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 922c420fcd4dfbfc7e3bce4dd20d9b17a20b39f3
5-
refs/heads/try: d0da4cfee7d95d37bdf41a53081996c31ec26d2f
5+
refs/heads/try: f072984ac428cfc484402517270257402b41f9c0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/RELEASES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Version 0.10 (April 2014)
6363
documentation index page.
6464
* std: `std::condition` has been removed. All I/O errors are now propagated
6565
through the `Result` type. In order to assist with error handling, a
66-
`try!` macro for unwrapping errors with an early return and an lint for
66+
`try!` macro for unwrapping errors with an early return and a lint for
6767
unused results has been added. See #12039 for more information.
6868
* std: The `vec` module has been renamed to `slice`.
6969
* std: A new vector type, `Vec<T>`, has been added in preparation for DST.

branches/try/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fn parse_compile_flags(line: &str) -> Option<~str> {
170170
}
171171

172172
fn parse_run_flags(line: &str) -> Option<~str> {
173-
parse_name_value_directive(line, ~"run-flags")
173+
parse_name_value_directive(line, "run-flags".to_owned())
174174
}
175175

176176
fn parse_debugger_cmd(line: &str) -> Option<~str> {

branches/try/src/doc/guide-container.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,13 @@ differently.
120120
Containers implement iteration over the contained elements by returning an
121121
iterator object. For example, vector slices several iterators available:
122122
123-
* `iter()` and `rev_iter()`, for immutable references to the elements
124-
* `mut_iter()` and `mut_rev_iter()`, for mutable references to the elements
125-
* `move_iter()` and `move_rev_iter()`, to move the elements out by-value
123+
* `iter()` for immutable references to the elements
124+
* `mut_iter()` for mutable references to the elements
125+
* `move_iter()` to move the elements out by-value
126126
127127
A typical mutable container will implement at least `iter()`, `mut_iter()` and
128-
`move_iter()` along with the reverse variants if it maintains an order.
128+
`move_iter()`. If it maintains an order, the returned iterators will be
129+
`DoubleEndedIterator`s, which are described below.
129130
130131
### Freezing
131132
@@ -265,7 +266,7 @@ Iterators offer generic conversion to containers with the `collect` adaptor:
265266
266267
~~~
267268
let xs = [0, 1, 1, 2, 3, 5, 8];
268-
let ys = xs.rev_iter().skip(1).map(|&x| x * 2).collect::<~[int]>();
269+
let ys = xs.iter().rev().skip(1).map(|&x| x * 2).collect::<~[int]>();
269270
assert_eq!(ys, ~[10, 6, 4, 2, 2, 0]);
270271
~~~
271272
@@ -358,9 +359,6 @@ for &x in it.rev() {
358359
}
359360
~~~
360361

361-
The `rev_iter` and `mut_rev_iter` methods on vectors just return an inverted
362-
version of the standard immutable and mutable vector iterators.
363-
364362
The `chain`, `map`, `filter`, `filter_map` and `inspect` adaptors are
365363
`DoubleEndedIterator` implementations if the underlying iterators are.
366364

branches/try/src/doc/guide-lifetimes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ process is called *rooting*.
263263
The previous example demonstrated *rooting*, the process by which the
264264
compiler ensures that managed boxes remain live for the duration of a
265265
borrow. Unfortunately, rooting does not work for borrows of owned
266-
boxes, because it is not possible to have two references to a owned
266+
boxes, because it is not possible to have two references to an owned
267267
box.
268268

269269
For owned boxes, therefore, the compiler will only allow a borrow *if
@@ -462,7 +462,7 @@ of a `f64` as if it were a struct with two fields would be a memory
462462
safety violation.
463463

464464
So, in fact, for every `ref` binding, the compiler will impose the
465-
same rules as the ones we saw for borrowing the interior of a owned
465+
same rules as the ones we saw for borrowing the interior of an owned
466466
box: it must be able to guarantee that the `enum` will not be
467467
overwritten for the duration of the borrow. In fact, the compiler
468468
would accept the example we gave earlier. The example is safe because

branches/try/src/doc/guide-unsafe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ standard library types, e.g. `Cell` and `RefCell`, that provide inner
5656
mutability by replacing compile time guarantees with dynamic checks at
5757
runtime.
5858

59-
An `&mut` reference has a stronger requirement: when a object has an
59+
An `&mut` reference has a stronger requirement: when an object has an
6060
`&mut T` pointing into it, then that `&mut` reference must be the only
6161
such usable path to that object in the whole program. That is, an
6262
`&mut` cannot alias with any other references.

branches/try/src/doc/rust.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Comments in Rust code follow the general C++ style of line and block-comment for
161161
with no nesting of block-comment delimiters.
162162

163163
Line comments beginning with exactly _three_ slashes (`///`), and block
164-
comments beginning with a exactly one repeated asterisk in the block-open
164+
comments beginning with exactly one repeated asterisk in the block-open
165165
sequence (`/**`), are interpreted as a special syntax for `doc`
166166
[attributes](#attributes). That is, they are equivalent to writing
167167
`#[doc="..."]` around the body of the comment (this includes the comment
@@ -365,7 +365,7 @@ of integer literal suffix:
365365
give the literal the corresponding machine type.
366366

367367
The type of an _unsuffixed_ integer literal is determined by type inference.
368-
If a integer type can be _uniquely_ determined from the surrounding program
368+
If an integer type can be _uniquely_ determined from the surrounding program
369369
context, the unsuffixed integer literal has that type. If the program context
370370
underconstrains the type, the unsuffixed integer literal's type is `int`; if
371371
the program context overconstrains the type, it is considered a static type
@@ -2184,7 +2184,7 @@ Supported traits for `deriving` are:
21842184
* `Hash`, to iterate over the bytes in a data type.
21852185
* `Rand`, to create a random instance of a data type.
21862186
* `Default`, to create an empty instance of a data type.
2187-
* `Zero`, to create an zero instance of a numeric data type.
2187+
* `Zero`, to create a zero instance of a numeric data type.
21882188
* `FromPrimitive`, to create an instance from a numeric primitive.
21892189
* `Show`, to format a value using the `{}` formatter.
21902190

branches/try/src/doc/tutorial.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ fn eq(xs: &List, ys: &List) -> bool {
11971197
match (xs, ys) {
11981198
// If we have reached the end of both lists, they are equal.
11991199
(&Nil, &Nil) => true,
1200-
// If the current element in both lists is equal, keep going.
1200+
// If the current elements of both lists are equal, keep going.
12011201
(&Cons(x, ~ref next_xs), &Cons(y, ~ref next_ys))
12021202
if x == y => eq(next_xs, next_ys),
12031203
// If the current elements are not equal, the lists are not equal.
@@ -1304,7 +1304,7 @@ fn eq<T: Eq>(xs: &List<T>, ys: &List<T>) -> bool {
13041304
match (xs, ys) {
13051305
// If we have reached the end of both lists, they are equal.
13061306
(&Nil, &Nil) => true,
1307-
// If the current element in both lists is equal, keep going.
1307+
// If the current elements of both lists are equal, keep going.
13081308
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys))
13091309
if x == y => eq(next_xs, next_ys),
13101310
// If the current elements are not equal, the lists are not equal.
@@ -1333,7 +1333,7 @@ impl<T: Eq> Eq for List<T> {
13331333
match (self, ys) {
13341334
// If we have reached the end of both lists, they are equal.
13351335
(&Nil, &Nil) => true,
1336-
// If the current element in both lists is equal, keep going.
1336+
// If the current elements of both lists are equal, keep going.
13371337
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys))
13381338
if x == y => next_xs == next_ys,
13391339
// If the current elements are not equal, the lists are not equal.
@@ -2965,7 +2965,7 @@ use farm::*;
29652965
~~~
29662966

29672967
> *Note:* This feature of the compiler is currently gated behind the
2968-
> `#[feature(globs)]` directive. More about these directives can be found in
2968+
> `#![feature(globs)]` directive. More about these directives can be found in
29692969
> the manual.
29702970
29712971
However, that's not all. You can also rename an item while you're bringing it into scope:
@@ -2980,7 +2980,7 @@ fn main() {
29802980
}
29812981
~~~
29822982

2983-
In general, `use` creates an local alias:
2983+
In general, `use` creates a local alias:
29842984
An alternate path and a possibly different name to access the same item,
29852985
without touching the original, and with both being interchangeable.
29862986

branches/try/src/etc/zsh/_rust

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ _rustc_opts_lint=(
6868
'unsafe-block[usage of an `unsafe` block]'
6969
'unstable[detects use of #\[unstable\] items (incl. items with no stability attribute)]'
7070
'unused-imports[imports that are never used]'
71-
'unused-must-use[unused result of an type flagged as #\[must_use\]]'
71+
'unused-must-use[unused result of a type flagged as #\[must_use\]]'
7272
"unused-mut[detect mut variables which don't need to be mutable]"
7373
'unused-result[unused result of an expression in a statement]'
7474
'unused-unsafe[unnecessary use of an `unsafe` block]'

branches/try/src/libcollections/bitv.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ impl Bitv {
425425
}
426426

427427
#[inline]
428+
#[deprecated = "replaced by .iter().rev()"]
428429
pub fn rev_iter<'a>(&'a self) -> Rev<Bits<'a>> {
429430
self.iter().rev()
430431
}

branches/try/src/libcollections/dlist.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -370,8 +370,8 @@ impl<T> DList<T> {
370370
Items{nelem: self.len(), head: &self.list_head, tail: self.list_tail}
371371
}
372372

373-
/// Provide a reverse iterator
374373
#[inline]
374+
#[deprecated = "replaced by .iter().rev()"]
375375
pub fn rev_iter<'a>(&'a self) -> Rev<Items<'a, T>> {
376376
self.iter().rev()
377377
}
@@ -390,8 +390,9 @@ impl<T> DList<T> {
390390
list: self
391391
}
392392
}
393-
/// Provide a reverse iterator with mutable references
393+
394394
#[inline]
395+
#[deprecated = "replaced by .mut_iter().rev()"]
395396
pub fn mut_rev_iter<'a>(&'a mut self) -> Rev<MutItems<'a, T>> {
396397
self.mut_iter().rev()
397398
}
@@ -403,8 +404,8 @@ impl<T> DList<T> {
403404
MoveItems{list: self}
404405
}
405406

406-
/// Consume the list into an iterator yielding elements by value, in reverse
407407
#[inline]
408+
#[deprecated = "replaced by .move_iter().rev()"]
408409
pub fn move_rev_iter(self) -> Rev<MoveItems<T>> {
409410
self.move_iter().rev()
410411
}
@@ -849,13 +850,13 @@ mod tests {
849850
#[test]
850851
fn test_rev_iter() {
851852
let m = generate_test();
852-
for (i, elt) in m.rev_iter().enumerate() {
853+
for (i, elt) in m.iter().rev().enumerate() {
853854
assert_eq!((6 - i) as int, *elt);
854855
}
855856
let mut n = DList::new();
856-
assert_eq!(n.rev_iter().next(), None);
857+
assert_eq!(n.iter().rev().next(), None);
857858
n.push_front(4);
858-
let mut it = n.rev_iter();
859+
let mut it = n.iter().rev();
859860
assert_eq!(it.size_hint(), (1, Some(1)));
860861
assert_eq!(it.next().unwrap(), &4);
861862
assert_eq!(it.size_hint(), (0, Some(0)));
@@ -958,13 +959,13 @@ mod tests {
958959
#[test]
959960
fn test_mut_rev_iter() {
960961
let mut m = generate_test();
961-
for (i, elt) in m.mut_rev_iter().enumerate() {
962+
for (i, elt) in m.mut_iter().rev().enumerate() {
962963
assert_eq!((6-i) as int, *elt);
963964
}
964965
let mut n = DList::new();
965-
assert!(n.mut_rev_iter().next().is_none());
966+
assert!(n.mut_iter().rev().next().is_none());
966967
n.push_front(4);
967-
let mut it = n.mut_rev_iter();
968+
let mut it = n.mut_iter().rev();
968969
assert!(it.next().is_some());
969970
assert!(it.next().is_none());
970971
}
@@ -1164,15 +1165,15 @@ mod tests {
11641165
let v = &[0, ..128];
11651166
let m: DList<int> = v.iter().map(|&x|x).collect();
11661167
b.iter(|| {
1167-
assert!(m.rev_iter().len() == 128);
1168+
assert!(m.iter().rev().len() == 128);
11681169
})
11691170
}
11701171
#[bench]
11711172
fn bench_iter_mut_rev(b: &mut test::Bencher) {
11721173
let v = &[0, ..128];
11731174
let mut m: DList<int> = v.iter().map(|&x|x).collect();
11741175
b.iter(|| {
1175-
assert!(m.mut_rev_iter().len() == 128);
1176+
assert!(m.mut_iter().rev().len() == 128);
11761177
})
11771178
}
11781179
}

branches/try/src/libcollections/hashmap.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ mod table {
278278
/// the appropriate types to pass on to most of the other functions in
279279
/// this module.
280280
pub fn peek(&self, index: uint) -> BucketState {
281-
// FIXME #12049
282-
if cfg!(test) { assert!(index < self.capacity) }
281+
debug_assert!(index < self.capacity);
283282

284283
let idx = index as int;
285284
let hash = unsafe { *self.hashes.offset(idx) };
@@ -306,8 +305,7 @@ mod table {
306305
let idx = index.idx;
307306

308307
unsafe {
309-
// FIXME #12049
310-
if cfg!(test) { assert!(*self.hashes.offset(idx) != EMPTY_BUCKET) }
308+
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
311309
(&'a *self.keys.offset(idx),
312310
&'a *self.vals.offset(idx))
313311
}
@@ -319,8 +317,7 @@ mod table {
319317
let idx = index.idx;
320318

321319
unsafe {
322-
// FIXME #12049
323-
if cfg!(test) { assert!(*self.hashes.offset(idx) != EMPTY_BUCKET) }
320+
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
324321
(&'a *self.keys.offset(idx),
325322
&'a mut *self.vals.offset(idx))
326323
}
@@ -332,8 +329,7 @@ mod table {
332329
let idx = index.idx;
333330

334331
unsafe {
335-
// FIXME #12049
336-
if cfg!(test) { assert!(*self.hashes.offset(idx) != EMPTY_BUCKET) }
332+
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
337333
(transmute(self.hashes.offset(idx)),
338334
&'a mut *self.keys.offset(idx),
339335
&'a mut *self.vals.offset(idx))
@@ -351,8 +347,7 @@ mod table {
351347
let idx = index.idx;
352348

353349
unsafe {
354-
// FIXME #12049
355-
if cfg!(test) { assert_eq!(*self.hashes.offset(idx), EMPTY_BUCKET) }
350+
debug_assert_eq!(*self.hashes.offset(idx), EMPTY_BUCKET);
356351
*self.hashes.offset(idx) = hash.inspect();
357352
move_val_init(&mut *self.keys.offset(idx), k);
358353
move_val_init(&mut *self.vals.offset(idx), v);
@@ -371,8 +366,7 @@ mod table {
371366
let idx = index.idx;
372367

373368
unsafe {
374-
// FIXME #12049
375-
if cfg!(test) { assert!(*self.hashes.offset(idx) != EMPTY_BUCKET) }
369+
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
376370

377371
*self.hashes.offset(idx) = EMPTY_BUCKET;
378372

@@ -698,13 +692,13 @@ static INITIAL_LOAD_FACTOR: Fraction = (9, 10);
698692
/// book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.");
699693
///
700694
/// // check for a specific one.
701-
/// if !book_reviews.contains_key(& &"Les Misérables") {
695+
/// if !book_reviews.contains_key(&("Les Misérables")) {
702696
/// println!("We've got {} reviews, but Les Misérables ain't one.",
703697
/// book_reviews.len());
704698
/// }
705699
///
706700
/// // oops, this review has a lot of spelling mistakes, let's delete it.
707-
/// book_reviews.remove(& &"The Adventures of Sherlock Holmes");
701+
/// book_reviews.remove(&("The Adventures of Sherlock Holmes"));
708702
///
709703
/// // look up the values associated with some keys.
710704
/// let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"];

branches/try/src/libcollections/priority_queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -382,7 +382,7 @@ mod tests {
382382
fn test_from_iter() {
383383
let xs = vec!(9u, 8, 7, 6, 5, 4, 3, 2, 1);
384384

385-
let mut q: PriorityQueue<uint> = xs.as_slice().rev_iter().map(|&x| x).collect();
385+
let mut q: PriorityQueue<uint> = xs.as_slice().iter().rev().map(|&x| x).collect();
386386

387387
for &x in xs.iter() {
388388
assert_eq!(q.pop(), x);

0 commit comments

Comments
 (0)