Skip to content

Commit 07a511c

Browse files
author
Nick Desaulniers
committed
---
yaml --- r: 46969 b: refs/heads/try c: 13fe167 h: refs/heads/master i: 46967: 5e01573 v: v3
1 parent 28a7f20 commit 07a511c

File tree

594 files changed

+1213
-1285
lines changed

Some content is hidden

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

594 files changed

+1213
-1285
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: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5-
refs/heads/try: af2f0ef0888d05209bddd16ab210ae0e8400b7de
5+
refs/heads/try: 13fe167dbb5a89f9cfad8b71e2c30e3b836aeb48
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/doc/rust.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -686,15 +686,15 @@ mod math {
686686
type complex = (f64, f64);
687687
fn sin(f: f64) -> f64 {
688688
...
689-
# die!();
689+
# fail!();
690690
}
691691
fn cos(f: f64) -> f64 {
692692
...
693-
# die!();
693+
# fail!();
694694
}
695695
fn tan(f: f64) -> f64 {
696696
...
697-
# die!();
697+
# fail!();
698698
}
699699
}
700700
~~~~~~~~
@@ -986,7 +986,7 @@ output slot type would normally be. For example:
986986
~~~~
987987
fn my_err(s: &str) -> ! {
988988
log(info, s);
989-
die!();
989+
fail!();
990990
}
991991
~~~~
992992

@@ -1004,7 +1004,7 @@ were declared without the `!` annotation, the following code would not
10041004
typecheck:
10051005

10061006
~~~~
1007-
# fn my_err(s: &str) -> ! { die!() }
1007+
# fn my_err(s: &str) -> ! { fail!() }
10081008
10091009
fn f(i: int) -> int {
10101010
if i == 42 {
@@ -2284,9 +2284,9 @@ enum List<X> { Nil, Cons(X, @List<X>) }
22842284
let x: List<int> = Cons(10, @Cons(11, @Nil));
22852285
22862286
match x {
2287-
Cons(_, @Nil) => die!(~"singleton list"),
2287+
Cons(_, @Nil) => fail!(~"singleton list"),
22882288
Cons(*) => return,
2289-
Nil => die!(~"empty list")
2289+
Nil => fail!(~"empty list")
22902290
}
22912291
~~~~
22922292

@@ -2323,7 +2323,7 @@ match x {
23232323
return;
23242324
}
23252325
_ => {
2326-
die!();
2326+
fail!();
23272327
}
23282328
}
23292329
~~~~
@@ -2411,7 +2411,7 @@ guard may refer to the variables bound within the pattern they follow.
24112411
let message = match maybe_digit {
24122412
Some(x) if x < 10 => process_digit(x),
24132413
Some(x) => process_other(x),
2414-
None => die!()
2414+
None => fail!()
24152415
};
24162416
~~~~
24172417

branches/try/doc/tutorial-macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ match x {
218218
// complicated stuff goes here
219219
return result + val;
220220
},
221-
_ => die!(~"Didn't get good_2")
221+
_ => fail!(~"Didn't get good_2")
222222
}
223223
}
224224
_ => return 0 // default value
@@ -260,7 +260,7 @@ macro_rules! biased_match (
260260
biased_match!((x) ~ (good_1(g1, val)) else { return 0 };
261261
binds g1, val )
262262
biased_match!((g1.body) ~ (good_2(result) )
263-
else { die!(~"Didn't get good_2") };
263+
else { fail!(~"Didn't get good_2") };
264264
binds result )
265265
// complicated stuff goes here
266266
return result + val;
@@ -362,7 +362,7 @@ macro_rules! biased_match (
362362
# fn f(x: t1) -> uint {
363363
biased_match!(
364364
(x) ~ (good_1(g1, val)) else { return 0 };
365-
(g1.body) ~ (good_2(result) ) else { die!(~"Didn't get good_2") };
365+
(g1.body) ~ (good_2(result) ) else { fail!(~"Didn't get good_2") };
366366
binds val, result )
367367
// complicated stuff goes here
368368
return result + val;

branches/try/doc/tutorial-tasks.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ of all tasks are intertwined: if one fails, so do all the others.
313313
# fn do_some_work() { loop { task::yield() } }
314314
# do task::try {
315315
// Create a child task that fails
316-
do spawn { die!() }
316+
do spawn { fail!() }
317317
318318
// This will also fail because the task we spawned failed
319319
do_some_work();
@@ -337,7 +337,7 @@ let result: Result<int, ()> = do task::try {
337337
if some_condition() {
338338
calculate_result()
339339
} else {
340-
die!(~"oops!");
340+
fail!(~"oops!");
341341
}
342342
};
343343
assert result.is_err();
@@ -370,14 +370,14 @@ proceed). Hence, you will need different _linked failure modes_.
370370
## Failure modes
371371

372372
By default, task failure is _bidirectionally linked_, which means that if
373-
either task dies, it kills the other one.
373+
either task fails, it kills the other one.
374374

375375
~~~
376376
# fn sleep_forever() { loop { task::yield() } }
377377
# do task::try {
378378
do task::spawn {
379379
do task::spawn {
380-
die!(); // All three tasks will die.
380+
fail!(); // All three tasks will fail.
381381
}
382382
sleep_forever(); // Will get woken up by force, then fail
383383
}
@@ -386,7 +386,7 @@ sleep_forever(); // Will get woken up by force, then fail
386386
~~~
387387

388388
If you want parent tasks to be able to kill their children, but do not want a
389-
parent to die automatically if one of its child task dies, you can call
389+
parent to fail automatically if one of its child task fails, you can call
390390
`task::spawn_supervised` for _unidirectionally linked_ failure. The
391391
function `task::try`, which we saw previously, uses `spawn_supervised`
392392
internally, with additional logic to wait for the child task to finish
@@ -432,7 +432,7 @@ do task::spawn_supervised {
432432
// Intermediate task immediately exits
433433
}
434434
wait_for_a_while();
435-
die!(); // Will kill grandchild even if child has already exited
435+
fail!(); // Will kill grandchild even if child has already exited
436436
# };
437437
~~~
438438

@@ -446,10 +446,10 @@ other at all, using `task::spawn_unlinked` for _isolated failure_.
446446
let (time1, time2) = (random(), random());
447447
do task::spawn_unlinked {
448448
sleep_for(time2); // Won't get forced awake
449-
die!();
449+
fail!();
450450
}
451451
sleep_for(time1); // Won't get forced awake
452-
die!();
452+
fail!();
453453
// It will take MAX(time1,time2) for the program to finish.
454454
# };
455455
~~~

branches/try/src/etc/licenseck.py

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
# option. This file may not be copied, modified, or distributed
99
# except according to those terms.
1010

11-
license0 = """\
12-
// Copyright 2012-2013 The Rust Project Developers. See the
11+
license0 = """// Copyright 2012-2013 The Rust Project Developers. See the
1312
// COPYRIGHT file at the top-level directory of this distribution and at
1413
// http://rust-lang.org/COPYRIGHT.
1514
//
@@ -20,8 +19,7 @@
2019
// except according to those terms.
2120
"""
2221

23-
license1 = """\
24-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
22+
license1 = """// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2523
// file at the top-level directory of this distribution and at
2624
// http://rust-lang.org/COPYRIGHT.
2725
//
@@ -32,8 +30,7 @@
3230
// except according to those terms.
3331
"""
3432

35-
license2 = """\
36-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
33+
license2 = """// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
3734
// file at the top-level directory of this distribution and at
3835
// http://rust-lang.org/COPYRIGHT.
3936
//
@@ -44,8 +41,7 @@
4441
// except according to those terms.
4542
"""
4643

47-
license3 = """\
48-
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
44+
license3 = """# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
4945
# file at the top-level directory of this distribution and at
5046
# http://rust-lang.org/COPYRIGHT.
5147
#
@@ -56,19 +52,7 @@
5652
# except according to those terms.
5753
"""
5854

59-
license4 = """\
60-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
61-
// file at the top-level directory of this distribution and at
62-
// http://rust-lang.org/COPYRIGHT.
63-
//
64-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
65-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
66-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
67-
// option. This file may not be copied, modified, or distributed
68-
// except according to those terms.
69-
"""
70-
71-
licenses = [license0, license1, license2, license3, license4]
55+
licenses = [license0, license1, license2, license3]
7256

7357
exceptions = [
7458
"rt/rust_android_dummy.cpp", # BSD, chromium

branches/try/src/libcore/bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn all_values(blk: fn(v: bool)) {
7474
pub pure fn to_bit(v: bool) -> u8 { if v { 1u8 } else { 0u8 } }
7575

7676
#[cfg(notest)]
77-
impl cmp::Eq for bool {
77+
impl bool : cmp::Eq {
7878
pure fn eq(&self, other: &bool) -> bool { (*self) == (*other) }
7979
pure fn ne(&self, other: &bool) -> bool { (*self) != (*other) }
8080
}

branches/try/src/libcore/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub pure fn cmp(a: char, b: char) -> int {
251251
}
252252

253253
#[cfg(notest)]
254-
impl Eq for char {
254+
impl char : Eq {
255255
pure fn eq(&self, other: &char) -> bool { (*self) == (*other) }
256256
pure fn ne(&self, other: &char) -> bool { (*self) != (*other) }
257257
}

branches/try/src/libcore/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub trait Clone {
1515
fn clone(&self) -> Self;
1616
}
1717

18-
impl Clone for () {
18+
impl (): Clone {
1919
#[inline(always)]
2020
fn clone(&self) -> () { () }
2121
}

branches/try/src/libcore/condition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct Guard<T, U> {
8484
cond: &Condition<T, U>
8585
}
8686

87-
impl<T, U> Drop for Guard<T, U> {
87+
impl<T, U> Guard<T, U> : Drop {
8888
fn finalize(&self) {
8989
unsafe {
9090
debug!("Guard: popping handler from TLS");

branches/try/src/libcore/dvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ impl<A: Copy> DVec<A> {
358358
}
359359
}
360360

361-
impl<A:Copy> Index<uint,A> for DVec<A> {
361+
impl<A:Copy> DVec<A>: Index<uint,A> {
362362
#[inline(always)]
363363
pure fn index(&self, idx: uint) -> A {
364364
self.get_elt(idx)

branches/try/src/libcore/hash.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub trait HashUtil {
5959
pure fn hash() -> u64;
6060
}
6161

62-
impl<A: Hash> HashUtil for A {
62+
impl <A: Hash> A: HashUtil {
6363
#[inline(always)]
6464
pure fn hash() -> u64 { self.hash_keyed(0,0) }
6565
}
@@ -74,7 +74,7 @@ pub trait Streaming {
7474
fn reset();
7575
}
7676

77-
impl<A: IterBytes> Hash for A {
77+
impl <A: IterBytes> A: Hash {
7878
#[inline(always)]
7979
pure fn hash_keyed(k0: u64, k1: u64) -> u64 {
8080
unsafe {
@@ -187,7 +187,7 @@ fn SipState(key0: u64, key1: u64) -> SipState {
187187
}
188188

189189

190-
impl io::Writer for SipState {
190+
impl SipState : io::Writer {
191191

192192
// Methods for io::writer
193193
#[inline(always)]
@@ -295,7 +295,7 @@ impl io::Writer for SipState {
295295
}
296296
}
297297

298-
impl Streaming for &SipState {
298+
impl &SipState : Streaming {
299299

300300
#[inline(always)]
301301
fn input(buf: &[const u8]) {

branches/try/src/libcore/hashmap.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub mod linear {
240240
}
241241
}
242242
243-
impl<K: Hash IterBytes Eq, V> BaseIter<(&K, &V)> for LinearMap<K, V> {
243+
impl <K: Hash IterBytes Eq, V> LinearMap<K, V>: BaseIter<(&K, &V)> {
244244
/// Visit all key-value pairs
245245
pure fn each(&self, blk: fn(&(&self/K, &self/V)) -> bool) {
246246
for uint::range(0, self.buckets.len()) |i| {
@@ -257,15 +257,15 @@ pub mod linear {
257257
}
258258
259259
260-
impl<K: Hash IterBytes Eq, V> Container for LinearMap<K, V> {
260+
impl <K: Hash IterBytes Eq, V> LinearMap<K, V>: Container {
261261
/// Return the number of elements in the map
262262
pure fn len(&self) -> uint { self.size }
263263
264264
/// Return true if the map contains no elements
265265
pure fn is_empty(&self) -> bool { self.len() == 0 }
266266
}
267267
268-
impl<K: Hash IterBytes Eq, V> Mutable for LinearMap<K, V> {
268+
impl <K: Hash IterBytes Eq, V> LinearMap<K, V>: Mutable {
269269
/// Clear the map, removing all key-value pairs.
270270
fn clear(&mut self) {
271271
for uint::range(0, self.buckets.len()) |idx| {
@@ -275,7 +275,7 @@ pub mod linear {
275275
}
276276
}
277277
278-
impl<K: Hash IterBytes Eq, V> Map<K, V> for LinearMap<K, V> {
278+
impl <K: Hash IterBytes Eq, V> LinearMap<K, V>: Map<K, V> {
279279
/// Return true if the map contains a value for the specified key
280280
pure fn contains_key(&self, k: &K) -> bool {
281281
match self.bucket_for_key(k) {
@@ -443,7 +443,7 @@ pub mod linear {
443443
}
444444
}
445445

446-
impl<K: Hash IterBytes Eq, V: Eq> Eq for LinearMap<K, V> {
446+
impl<K: Hash IterBytes Eq, V: Eq> LinearMap<K, V>: Eq {
447447
pure fn eq(&self, other: &LinearMap<K, V>) -> bool {
448448
if self.len() != other.len() { return false; }
449449

@@ -464,13 +464,13 @@ pub mod linear {
464464
priv map: LinearMap<T, ()>
465465
}
466466

467-
impl<T: Hash IterBytes Eq> BaseIter<T> for LinearSet<T> {
467+
impl <T: Hash IterBytes Eq> LinearSet<T>: BaseIter<T> {
468468
/// Visit all values in order
469469
pure fn each(&self, f: fn(&T) -> bool) { self.map.each_key(f) }
470470
pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
471471
}
472472

473-
impl<T: Hash IterBytes Eq> Eq for LinearSet<T> {
473+
impl <T: Hash IterBytes Eq> LinearSet<T>: Eq {
474474
pure fn eq(&self, other: &LinearSet<T>) -> bool {
475475
self.map == other.map
476476
}
@@ -479,20 +479,20 @@ pub mod linear {
479479
}
480480
}
481481

482-
impl<T: Hash IterBytes Eq> Container for LinearSet<T> {
482+
impl <T: Hash IterBytes Eq> LinearSet<T>: Container {
483483
/// Return the number of elements in the set
484484
pure fn len(&self) -> uint { self.map.len() }
485485

486486
/// Return true if the set contains no elements
487487
pure fn is_empty(&self) -> bool { self.map.is_empty() }
488488
}
489489

490-
impl<T: Hash IterBytes Eq> Mutable for LinearSet<T> {
490+
impl <T: Hash IterBytes Eq> LinearSet<T>: Mutable {
491491
/// Clear the set, removing all values.
492492
fn clear(&mut self) { self.map.clear() }
493493
}
494494

495-
impl<T: Hash IterBytes Eq> Set<T> for LinearSet<T> {
495+
impl <T: Hash IterBytes Eq> LinearSet<T>: Set<T> {
496496
/// Return true if the set contains a value
497497
pure fn contains(&self, value: &T) -> bool {
498498
self.map.contains_key(value)

0 commit comments

Comments
 (0)