Skip to content

Commit b7157ca

Browse files
committed
---
yaml --- r: 61263 b: refs/heads/try c: bdc182c h: refs/heads/master i: 61261: 5b94832 61259: 0da4fc7 61255: d2cc0eb 61247: 9d782c8 v: v3
1 parent ca0cdae commit b7157ca

File tree

181 files changed

+994
-577
lines changed

Some content is hidden

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

181 files changed

+994
-577
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
5-
refs/heads/try: 87398f31e5615bef744f2ac3f66c00b1a7d4959e
5+
refs/heads/try: bdc182cc41c2741edc6fdc4ec09b8522479aab40
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,9 +2386,9 @@ enum List<X> { Nil, Cons(X, @List<X>) }
23862386
let x: List<int> = Cons(10, @Cons(11, @Nil));
23872387
23882388
match x {
2389-
Cons(_, @Nil) => fail!(~"singleton list"),
2389+
Cons(_, @Nil) => fail!("singleton list"),
23902390
Cons(*) => return,
2391-
Nil => fail!(~"empty list")
2391+
Nil => fail!("empty list")
23922392
}
23932393
~~~~
23942394

branches/try/doc/tutorial-macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ match x {
223223
// complicated stuff goes here
224224
return result + val;
225225
},
226-
_ => fail!(~"Didn't get good_2")
226+
_ => fail!("Didn't get good_2")
227227
}
228228
}
229229
_ => return 0 // default value
@@ -265,7 +265,7 @@ macro_rules! biased_match (
265265
biased_match!((x) ~ (good_1(g1, val)) else { return 0 };
266266
binds g1, val )
267267
biased_match!((g1.body) ~ (good_2(result) )
268-
else { fail!(~"Didn't get good_2") };
268+
else { fail!("Didn't get good_2") };
269269
binds result )
270270
// complicated stuff goes here
271271
return result + val;
@@ -366,7 +366,7 @@ macro_rules! biased_match (
366366
# fn f(x: t1) -> uint {
367367
biased_match!(
368368
(x) ~ (good_1(g1, val)) else { return 0 };
369-
(g1.body) ~ (good_2(result) ) else { fail!(~"Didn't get good_2") };
369+
(g1.body) ~ (good_2(result) ) else { fail!("Didn't get good_2") };
370370
binds val, result )
371371
// complicated stuff goes here
372372
return result + val;

branches/try/doc/tutorial-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ let result: Result<int, ()> = do task::try {
325325
if some_condition() {
326326
calculate_result()
327327
} else {
328-
fail!(~"oops!");
328+
fail!("oops!");
329329
}
330330
};
331331
assert!(result.is_err());

branches/try/src/compiletest/compiletest.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub fn str_mode(s: ~str) -> mode {
151151
~"run-pass" => mode_run_pass,
152152
~"pretty" => mode_pretty,
153153
~"debug-info" => mode_debug_info,
154-
_ => fail!(~"invalid mode")
154+
_ => fail!("invalid mode")
155155
}
156156
}
157157

@@ -169,7 +169,7 @@ pub fn run_tests(config: config) {
169169
let opts = test_opts(config);
170170
let tests = make_tests(config);
171171
let res = test::run_tests_console(&opts, tests);
172-
if !res { fail!(~"Some tests failed"); }
172+
if !res { fail!("Some tests failed"); }
173173
}
174174

175175
pub fn test_opts(config: config) -> test::TestOpts {

branches/try/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn parse_exec_env(line: ~str) -> Option<(~str, ~str)> {
139139
match strs.len() {
140140
1u => (strs[0], ~""),
141141
2u => (strs[0], strs[1]),
142-
n => fail!(fmt!("Expected 1 or 2 strings, not %u", n))
142+
n => fail!("Expected 1 or 2 strings, not %u", n)
143143
}
144144
}
145145
}

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ fn compose_and_run_compiler(
561561
fn ensure_dir(path: &Path) {
562562
if os::path_is_dir(path) { return; }
563563
if !os::make_dir(path, 0x1c0i32) {
564-
fail!(fmt!("can't make dir %s", path.to_str()));
564+
fail!("can't make dir %s", path.to_str());
565565
}
566566
}
567567

branches/try/src/libcore/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub impl<T> Cell<T> {
4646
fn take(&self) -> T {
4747
let this = unsafe { transmute_mut(self) };
4848
if this.is_empty() {
49-
fail!(~"attempt to take an empty cell");
49+
fail!("attempt to take an empty cell");
5050
}
5151

5252
replace(&mut this.value, None).unwrap()
@@ -56,7 +56,7 @@ pub impl<T> Cell<T> {
5656
fn put_back(&self, value: T) {
5757
let this = unsafe { transmute_mut(self) };
5858
if !this.is_empty() {
59-
fail!(~"attempt to put a value back into a full cell");
59+
fail!("attempt to put a value back into a full cell");
6060
}
6161
this.value = Some(value);
6262
}

branches/try/src/libcore/char.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pub fn is_digit_radix(c: char, radix: uint) -> bool {
145145
#[inline]
146146
pub fn to_digit(c: char, radix: uint) -> Option<uint> {
147147
if radix > 36 {
148-
fail!(fmt!("to_digit: radix %? is to high (maximum 36)", radix));
148+
fail!("to_digit: radix %? is to high (maximum 36)", radix);
149149
}
150150
let val = match c {
151151
'0' .. '9' => c as uint - ('0' as uint),
@@ -168,7 +168,7 @@ pub fn to_digit(c: char, radix: uint) -> Option<uint> {
168168
#[inline]
169169
pub fn from_digit(num: uint, radix: uint) -> Option<char> {
170170
if radix > 36 {
171-
fail!(fmt!("from_digit: radix %? is to high (maximum 36)", num));
171+
fail!("from_digit: radix %? is to high (maximum 36)", num);
172172
}
173173
if num < radix {
174174
if num < 10 {
@@ -241,7 +241,7 @@ pub fn len_utf8_bytes(c: char) -> uint {
241241
else if code < max_two_b { 2u }
242242
else if code < max_three_b { 3u }
243243
else if code < max_four_b { 4u }
244-
else { fail!(~"invalid character!") }
244+
else { fail!("invalid character!") }
245245
}
246246

247247
#[cfg(not(test))]

branches/try/src/libcore/comm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl<T: Owned> Peekable<T> for Port<T> {
210210
let mut endp = replace(self_endp, None);
211211
let peek = match endp {
212212
Some(ref mut endp) => peek(endp),
213-
None => fail!(~"peeking empty stream")
213+
None => fail!("peeking empty stream")
214214
};
215215
*self_endp = endp;
216216
peek
@@ -222,7 +222,7 @@ impl<T: Owned> Selectable for Port<T> {
222222
fn header(&mut self) -> *mut PacketHeader {
223223
match self.endp {
224224
Some(ref mut endp) => endp.header(),
225-
None => fail!(~"peeking empty stream")
225+
None => fail!("peeking empty stream")
226226
}
227227
}
228228
}
@@ -522,7 +522,7 @@ pub fn select2i<A:Selectable, B:Selectable>(a: &mut A, b: &mut B)
522522
match wait_many(endpoints) {
523523
0 => Left(()),
524524
1 => Right(()),
525-
_ => fail!(~"wait returned unexpected index"),
525+
_ => fail!("wait returned unexpected index"),
526526
}
527527
}
528528

branches/try/src/libcore/either.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn unwrap_left<T,U>(eith: Either<T,U>) -> T {
135135
136136
match eith {
137137
Left(x) => x,
138-
Right(_) => fail!(~"either::unwrap_left Right")
138+
Right(_) => fail!("either::unwrap_left Right")
139139
}
140140
}
141141

@@ -145,7 +145,7 @@ pub fn unwrap_right<T,U>(eith: Either<T,U>) -> U {
145145
146146
match eith {
147147
Right(x) => x,
148-
Left(_) => fail!(~"either::unwrap_right Left")
148+
Left(_) => fail!("either::unwrap_right Left")
149149
}
150150
}
151151

branches/try/src/libcore/hashmap.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ priv impl<K:Hash + Eq,V> HashMap<K, V> {
200200
fn value_for_bucket<'a>(&'a self, idx: uint) -> &'a V {
201201
match self.buckets[idx] {
202202
Some(ref bkt) => &bkt.value,
203-
None => fail!(~"HashMap::find: internal logic error"),
203+
None => fail!("HashMap::find: internal logic error"),
204204
}
205205
}
206206

@@ -217,7 +217,7 @@ priv impl<K:Hash + Eq,V> HashMap<K, V> {
217217
/// True if there was no previous entry with that key
218218
fn insert_internal(&mut self, hash: uint, k: K, v: V) -> Option<V> {
219219
match self.bucket_for_key_with_hash(hash, &k) {
220-
TableFull => { fail!(~"Internal logic error"); }
220+
TableFull => { fail!("Internal logic error"); }
221221
FoundHole(idx) => {
222222
debug!("insert fresh (%?->%?) at idx %?, hash %?",
223223
k, v, idx, hash);
@@ -230,7 +230,7 @@ priv impl<K:Hash + Eq,V> HashMap<K, V> {
230230
debug!("insert overwrite (%?->%?) at idx %?, hash %?",
231231
k, v, idx, hash);
232232
match self.buckets[idx] {
233-
None => { fail!(~"insert_internal: Internal logic error") }
233+
None => { fail!("insert_internal: Internal logic error") }
234234
Some(ref mut b) => {
235235
b.hash = hash;
236236
b.key = k;
@@ -500,7 +500,7 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
500500

501501
let hash = k.hash_keyed(self.k0, self.k1) as uint;
502502
let idx = match self.bucket_for_key_with_hash(hash, &k) {
503-
TableFull => fail!(~"Internal logic error"),
503+
TableFull => fail!("Internal logic error"),
504504
FoundEntry(idx) => idx,
505505
FoundHole(idx) => {
506506
self.buckets[idx] = Some(Bucket{hash: hash, key: k,
@@ -531,7 +531,7 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
531531

532532
let hash = k.hash_keyed(self.k0, self.k1) as uint;
533533
let idx = match self.bucket_for_key_with_hash(hash, &k) {
534-
TableFull => fail!(~"Internal logic error"),
534+
TableFull => fail!("Internal logic error"),
535535
FoundEntry(idx) => idx,
536536
FoundHole(idx) => {
537537
self.buckets[idx] = Some(Bucket{hash: hash, key: k,
@@ -560,7 +560,7 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
560560

561561
let hash = k.hash_keyed(self.k0, self.k1) as uint;
562562
let idx = match self.bucket_for_key_with_hash(hash, &k) {
563-
TableFull => fail!(~"Internal logic error"),
563+
TableFull => fail!("Internal logic error"),
564564
FoundEntry(idx) => idx,
565565
FoundHole(idx) => {
566566
let v = f(&k);
@@ -592,7 +592,7 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
592592

593593
let hash = k.hash_keyed(self.k0, self.k1) as uint;
594594
let idx = match self.bucket_for_key_with_hash(hash, &k) {
595-
TableFull => fail!(~"Internal logic error"),
595+
TableFull => fail!("Internal logic error"),
596596
FoundEntry(idx) => idx,
597597
FoundHole(idx) => {
598598
let v = f(&k);
@@ -623,7 +623,7 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
623623
fn get<'a>(&'a self, k: &K) -> &'a V {
624624
match self.find(k) {
625625
Some(v) => v,
626-
None => fail!(fmt!("No entry found for key: %?", k)),
626+
None => fail!("No entry found for key: %?", k),
627627
}
628628
}
629629

branches/try/src/libcore/local_data.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ fn test_tls_modify() {
132132
fn my_key(_x: @~str) { }
133133
local_data_modify(my_key, |data| {
134134
match data {
135-
Some(@ref val) => fail!(~"unwelcome value: " + *val),
135+
Some(@ref val) => fail!("unwelcome value: %s", *val),
136136
None => Some(@~"first data")
137137
}
138138
});
139139
local_data_modify(my_key, |data| {
140140
match data {
141141
Some(@~"first data") => Some(@~"next data"),
142-
Some(@ref val) => fail!(~"wrong value: " + *val),
143-
None => fail!(~"missing value")
142+
Some(@ref val) => fail!("wrong value: %s", *val),
143+
None => fail!("missing value")
144144
}
145145
});
146146
assert!(*(local_data_pop(my_key).get()) == ~"next data");
@@ -223,4 +223,4 @@ fn test_static_pointer() {
223223
static VALUE: int = 0;
224224
local_data_set(key, @&VALUE);
225225
}
226-
}
226+
}

0 commit comments

Comments
 (0)