Skip to content

Commit 41b49bf

Browse files
committed
---
yaml --- r: 113059 b: refs/heads/try c: 3a321b0 h: refs/heads/master i: 113057: 8fe1646 113055: 4b448b9 v: v3
1 parent 1879947 commit 41b49bf

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

+442
-390
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: 593f6a42d01070c7217c1241e8783b4e908884bb
5+
refs/heads/try: 3a321b001fd65ccbf34e626dbac6ab1ac2fa1ca3
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-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/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/treemap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,10 +1651,10 @@ mod test_set {
16511651

16521652
// FIXME: #5801: this needs a type hint to compile...
16531653
let result: Option<(&uint, & &'static str)> = z.next();
1654-
assert_eq!(result.unwrap(), (&5u, & &"bar"));
1654+
assert_eq!(result.unwrap(), (&5u, &("bar")));
16551655

16561656
let result: Option<(&uint, & &'static str)> = z.next();
1657-
assert_eq!(result.unwrap(), (&11u, & &"foo"));
1657+
assert_eq!(result.unwrap(), (&11u, &("foo")));
16581658

16591659
let result: Option<(&uint, & &'static str)> = z.next();
16601660
assert!(result.is_none());

branches/try/src/libgetopts/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ mod tests {
14411441
optmulti("l", "", "Desc", "VAL"));
14421442

14431443
let expected =
1444-
~"Usage: fruits
1444+
"Usage: fruits
14451445
14461446
Options:
14471447
-b --banana VAL Desc
@@ -1450,7 +1450,7 @@ Options:
14501450
-k --kiwi Desc
14511451
-p [VAL] Desc
14521452
-l VAL Desc
1453-
";
1453+
".to_owned();
14541454

14551455
let generated_usage = usage("Usage: fruits", optgroups.as_slice());
14561456

@@ -1471,13 +1471,13 @@ Options:
14711471
"This is a long description which _will_ be wrapped..+.."));
14721472

14731473
let expected =
1474-
~"Usage: fruits
1474+
"Usage: fruits
14751475
14761476
Options:
14771477
-k --kiwi This is a long description which won't be wrapped..+..
14781478
-a --apple This is a long description which _will_ be
14791479
wrapped..+..
1480-
";
1480+
".to_owned();
14811481

14821482
let usage = usage("Usage: fruits", optgroups.as_slice());
14831483

@@ -1496,14 +1496,14 @@ Options:
14961496
confuse the line wrapping; an apple costs 0.51€ in some parts of Europe."));
14971497

14981498
let expected =
1499-
~"Usage: fruits
1499+
"Usage: fruits
15001500
15011501
Options:
15021502
-k --k–w– The word kiwi is normally spelled with two i's
15031503
-a --apple This “description” has some characters that could
15041504
confuse the line wrapping; an apple costs 0.51€ in
15051505
some parts of Europe.
1506-
";
1506+
".to_owned();
15071507

15081508
let usage = usage("Usage: fruits", optgroups.as_slice());
15091509

branches/try/src/libnative/io/timer_win32.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl rtio::RtioTimer for Timer {
137137

138138
// there are 10^6 nanoseconds in a millisecond, and the parameter is in
139139
// 100ns intervals, so we multiply by 10^4.
140-
let due = -(msecs * 10000) as libc::LARGE_INTEGER;
140+
let due = -(msecs as i64 * 10000) as libc::LARGE_INTEGER;
141141
assert_eq!(unsafe {
142142
imp::SetWaitableTimer(self.obj, &due, 0, ptr::null(),
143143
ptr::mut_null(), 0)
@@ -151,7 +151,7 @@ impl rtio::RtioTimer for Timer {
151151
let (tx, rx) = channel();
152152

153153
// see above for the calculation
154-
let due = -(msecs * 10000) as libc::LARGE_INTEGER;
154+
let due = -(msecs as i64 * 10000) as libc::LARGE_INTEGER;
155155
assert_eq!(unsafe {
156156
imp::SetWaitableTimer(self.obj, &due, 0, ptr::null(),
157157
ptr::mut_null(), 0)
@@ -167,7 +167,7 @@ impl rtio::RtioTimer for Timer {
167167
let (tx, rx) = channel();
168168

169169
// see above for the calculation
170-
let due = -(msecs * 10000) as libc::LARGE_INTEGER;
170+
let due = -(msecs as i64 * 10000) as libc::LARGE_INTEGER;
171171
assert_eq!(unsafe {
172172
imp::SetWaitableTimer(self.obj, &due, msecs as libc::LONG,
173173
ptr::null(), ptr::mut_null(), 0)

branches/try/src/libregex/parse.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ impl<'a> Parser<'a> {
220220
try!(self.parse_group_opts())
221221
} else {
222222
self.caps += 1;
223-
self.stack.push(Paren(self.flags, self.caps, ~""))
223+
self.stack.push(Paren(self.flags,
224+
self.caps,
225+
"".to_owned()))
224226
}
225227
}
226228
')' => {
@@ -769,7 +771,7 @@ impl<'a> Parser<'a> {
769771
}
770772
if self.cur() == ':' {
771773
// Save the old flags with the opening paren.
772-
self.stack.push(Paren(self.flags, 0, ~""));
774+
self.stack.push(Paren(self.flags, 0, "".to_owned()));
773775
}
774776
self.flags = flags;
775777
return Ok(())

0 commit comments

Comments
 (0)