Skip to content

Commit 8a802fb

Browse files
committed
---
yaml --- r: 113062 b: refs/heads/try c: 6dd7a56 h: refs/heads/master v: v3
1 parent 403e926 commit 8a802fb

File tree

116 files changed

+2440
-2047
lines changed

Some content is hidden

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

116 files changed

+2440
-2047
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: d1ca0b13718f87f3f5498843f4e13d1b0b855c7e
5+
refs/heads/try: 6dd7a56ed46e6ca9cb75c6a7d01d100ca7a5c04d
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 a lint for
66+
`try!` macro for unwrapping errors with an early return and an 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".to_owned())
173+
parse_name_value_directive(line, ~"run-flags")
174174
}
175175

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

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,12 @@ 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()` 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
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
126126
127127
A typical mutable container will implement at least `iter()`, `mut_iter()` and
128-
`move_iter()`. If it maintains an order, the returned iterators will be
129-
`DoubleEndedIterator`s, which are described below.
128+
`move_iter()` along with the reverse variants if it maintains an order.
130129
131130
### Freezing
132131
@@ -266,7 +265,7 @@ Iterators offer generic conversion to containers with the `collect` adaptor:
266265
267266
~~~
268267
let xs = [0, 1, 1, 2, 3, 5, 8];
269-
let ys = xs.iter().rev().skip(1).map(|&x| x * 2).collect::<~[int]>();
268+
let ys = xs.rev_iter().skip(1).map(|&x| x * 2).collect::<~[int]>();
270269
assert_eq!(ys, ~[10, 6, 4, 2, 2, 0]);
271270
~~~
272271
@@ -359,6 +358,9 @@ for &x in it.rev() {
359358
}
360359
~~~
361360

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+
362364
The `chain`, `map`, `filter`, `filter_map` and `inspect` adaptors are
363365
`DoubleEndedIterator` implementations if the underlying iterators are.
364366

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 an owned
266+
boxes, because it is not possible to have two references to a 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 an owned
465+
same rules as the ones we saw for borrowing the interior of a 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 an object has an
59+
An `&mut` reference has a stronger requirement: when a 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 exactly one repeated asterisk in the block-open
164+
comments beginning with a 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 an integer type can be _uniquely_ determined from the surrounding program
368+
If a 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 a zero instance of a numeric data type.
2187+
* `Zero`, to create an 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 elements of both lists are equal, keep going.
1200+
// If the current element in both lists is 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 elements of both lists are equal, keep going.
1307+
// If the current element in both lists is 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 elements of both lists are equal, keep going.
1336+
// If the current element in both lists is 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 a local alias:
2983+
In general, `use` creates an 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 a type flagged as #\[must_use\]]'
71+
'unused-must-use[unused result of an 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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ impl Bitv {
425425
}
426426

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

branches/try/src/libcollections/dlist.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 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
373374
#[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,9 +390,8 @@ impl<T> DList<T> {
390390
list: self
391391
}
392392
}
393-
393+
/// Provide a reverse iterator with mutable references
394394
#[inline]
395-
#[deprecated = "replaced by .mut_iter().rev()"]
396395
pub fn mut_rev_iter<'a>(&'a mut self) -> Rev<MutItems<'a, T>> {
397396
self.mut_iter().rev()
398397
}
@@ -404,8 +403,8 @@ impl<T> DList<T> {
404403
MoveItems{list: self}
405404
}
406405

406+
/// Consume the list into an iterator yielding elements by value, in reverse
407407
#[inline]
408-
#[deprecated = "replaced by .move_iter().rev()"]
409408
pub fn move_rev_iter(self) -> Rev<MoveItems<T>> {
410409
self.move_iter().rev()
411410
}
@@ -850,13 +849,13 @@ mod tests {
850849
#[test]
851850
fn test_rev_iter() {
852851
let m = generate_test();
853-
for (i, elt) in m.iter().rev().enumerate() {
852+
for (i, elt) in m.rev_iter().enumerate() {
854853
assert_eq!((6 - i) as int, *elt);
855854
}
856855
let mut n = DList::new();
857-
assert_eq!(n.iter().rev().next(), None);
856+
assert_eq!(n.rev_iter().next(), None);
858857
n.push_front(4);
859-
let mut it = n.iter().rev();
858+
let mut it = n.rev_iter();
860859
assert_eq!(it.size_hint(), (1, Some(1)));
861860
assert_eq!(it.next().unwrap(), &4);
862861
assert_eq!(it.size_hint(), (0, Some(0)));
@@ -959,13 +958,13 @@ mod tests {
959958
#[test]
960959
fn test_mut_rev_iter() {
961960
let mut m = generate_test();
962-
for (i, elt) in m.mut_iter().rev().enumerate() {
961+
for (i, elt) in m.mut_rev_iter().enumerate() {
963962
assert_eq!((6-i) as int, *elt);
964963
}
965964
let mut n = DList::new();
966-
assert!(n.mut_iter().rev().next().is_none());
965+
assert!(n.mut_rev_iter().next().is_none());
967966
n.push_front(4);
968-
let mut it = n.mut_iter().rev();
967+
let mut it = n.mut_rev_iter();
969968
assert!(it.next().is_some());
970969
assert!(it.next().is_none());
971970
}
@@ -1165,15 +1164,15 @@ mod tests {
11651164
let v = &[0, ..128];
11661165
let m: DList<int> = v.iter().map(|&x|x).collect();
11671166
b.iter(|| {
1168-
assert!(m.iter().rev().len() == 128);
1167+
assert!(m.rev_iter().len() == 128);
11691168
})
11701169
}
11711170
#[bench]
11721171
fn bench_iter_mut_rev(b: &mut test::Bencher) {
11731172
let v = &[0, ..128];
11741173
let mut m: DList<int> = v.iter().map(|&x|x).collect();
11751174
b.iter(|| {
1176-
assert!(m.mut_iter().rev().len() == 128);
1175+
assert!(m.mut_rev_iter().len() == 128);
11771176
})
11781177
}
11791178
}

branches/try/src/libcollections/hashmap.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ 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-
debug_assert!(index < self.capacity);
281+
// FIXME #12049
282+
if cfg!(test) { assert!(index < self.capacity) }
282283

283284
let idx = index as int;
284285
let hash = unsafe { *self.hashes.offset(idx) };
@@ -305,7 +306,8 @@ mod table {
305306
let idx = index.idx;
306307

307308
unsafe {
308-
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
309+
// FIXME #12049
310+
if cfg!(test) { assert!(*self.hashes.offset(idx) != EMPTY_BUCKET) }
309311
(&'a *self.keys.offset(idx),
310312
&'a *self.vals.offset(idx))
311313
}
@@ -317,7 +319,8 @@ mod table {
317319
let idx = index.idx;
318320

319321
unsafe {
320-
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
322+
// FIXME #12049
323+
if cfg!(test) { assert!(*self.hashes.offset(idx) != EMPTY_BUCKET) }
321324
(&'a *self.keys.offset(idx),
322325
&'a mut *self.vals.offset(idx))
323326
}
@@ -329,7 +332,8 @@ mod table {
329332
let idx = index.idx;
330333

331334
unsafe {
332-
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
335+
// FIXME #12049
336+
if cfg!(test) { assert!(*self.hashes.offset(idx) != EMPTY_BUCKET) }
333337
(transmute(self.hashes.offset(idx)),
334338
&'a mut *self.keys.offset(idx),
335339
&'a mut *self.vals.offset(idx))
@@ -347,7 +351,8 @@ mod table {
347351
let idx = index.idx;
348352

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

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

371377
*self.hashes.offset(idx) = EMPTY_BUCKET;
372378

@@ -692,13 +698,13 @@ static INITIAL_LOAD_FACTOR: Fraction = (9, 10);
692698
/// book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.");
693699
///
694700
/// // check for a specific one.
695-
/// if !book_reviews.contains_key(&("Les Misérables")) {
701+
/// if !book_reviews.contains_key(& &"Les Misérables") {
696702
/// println!("We've got {} reviews, but Les Misérables ain't one.",
697703
/// book_reviews.len());
698704
/// }
699705
///
700706
/// // oops, this review has a lot of spelling mistakes, let's delete it.
701-
/// book_reviews.remove(&("The Adventures of Sherlock Holmes"));
707+
/// book_reviews.remove(& &"The Adventures of Sherlock Holmes");
702708
///
703709
/// // look up the values associated with some keys.
704710
/// 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-2014 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013 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().iter().rev().map(|&x| x).collect();
385+
let mut q: PriorityQueue<uint> = xs.as_slice().rev_iter().map(|&x| x).collect();
386386

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

0 commit comments

Comments
 (0)