diff options
| author | bors <bors@rust-lang.org> | 2013-02-13 17:11:08 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-02-13 17:11:08 -0800 |
| commit | 0ae74bef188fe4f1fff69c0fa85d308c40bce7f8 (patch) | |
| tree | f5258cb43faeb5f36f816e4a2d04442c987423b4 /src/libstd | |
| parent | c51ecc3223ed64b7948f40097c5083da0c201811 (diff) | |
| parent | 4445b38df27777b043cad9ecc2452daad3469949 (diff) | |
| download | rust-0ae74bef188fe4f1fff69c0fa85d308c40bce7f8.tar.gz rust-0ae74bef188fe4f1fff69c0fa85d308c40bce7f8.zip | |
auto merge of #4905 : brson/rust/issue4524, r=brson
Rebase of #4895
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/arc.rs | 8 | ||||
| -rw-r--r-- | src/libstd/arena.rs | 2 | ||||
| -rw-r--r-- | src/libstd/base64.rs | 8 | ||||
| -rw-r--r-- | src/libstd/bigint.rs | 18 | ||||
| -rw-r--r-- | src/libstd/bitv.rs | 6 | ||||
| -rw-r--r-- | src/libstd/cell.rs | 4 | ||||
| -rw-r--r-- | src/libstd/deque.rs | 2 | ||||
| -rw-r--r-- | src/libstd/ebml.rs | 38 | ||||
| -rw-r--r-- | src/libstd/flatpipes.rs | 6 | ||||
| -rw-r--r-- | src/libstd/future.rs | 6 | ||||
| -rw-r--r-- | src/libstd/getopts.rs | 96 | ||||
| -rw-r--r-- | src/libstd/json.rs | 40 | ||||
| -rw-r--r-- | src/libstd/list.rs | 4 | ||||
| -rw-r--r-- | src/libstd/net_ip.rs | 14 | ||||
| -rw-r--r-- | src/libstd/net_tcp.rs | 20 | ||||
| -rw-r--r-- | src/libstd/oldmap.rs | 2 | ||||
| -rw-r--r-- | src/libstd/oldsmallintmap.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rope.rs | 12 | ||||
| -rw-r--r-- | src/libstd/serialize.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sha1.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sort.rs | 14 | ||||
| -rw-r--r-- | src/libstd/sync.rs | 16 | ||||
| -rw-r--r-- | src/libstd/test.rs | 14 | ||||
| -rw-r--r-- | src/libstd/time.rs | 4 | ||||
| -rw-r--r-- | src/libstd/timer.rs | 6 | ||||
| -rw-r--r-- | src/libstd/uv_global_loop.rs | 4 | ||||
| -rw-r--r-- | src/libstd/workcache.rs | 2 |
27 files changed, 176 insertions, 176 deletions
diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index ff28d2cbebf..0a51a7ef191 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -224,7 +224,7 @@ pub fn unwrap_mutex_arc<T: Owned>(arc: MutexARC<T>) -> T { let inner = unsafe { unwrap_shared_mutable_state(move x) }; let MutexARCInner { failed: failed, data: data, _ } = move inner; if failed { - die!(~"Can't unwrap poisoned MutexARC - another task failed inside!") + fail!(~"Can't unwrap poisoned MutexARC - another task failed inside!") } move data } @@ -235,9 +235,9 @@ pub fn unwrap_mutex_arc<T: Owned>(arc: MutexARC<T>) -> T { fn check_poison(is_mutex: bool, failed: bool) { if failed { if is_mutex { - die!(~"Poisoned MutexARC - another task failed inside!"); + fail!(~"Poisoned MutexARC - another task failed inside!"); } else { - die!(~"Poisoned rw_arc - another task failed inside!"); + fail!(~"Poisoned rw_arc - another task failed inside!"); } } } @@ -423,7 +423,7 @@ pub fn unwrap_rw_arc<T: Const Owned>(arc: RWARC<T>) -> T { let inner = unsafe { unwrap_shared_mutable_state(move x) }; let RWARCInner { failed: failed, data: data, _ } = move inner; if failed { - die!(~"Can't unwrap poisoned RWARC - another task failed inside!") + fail!(~"Can't unwrap poisoned RWARC - another task failed inside!") } move data } diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs index a2cbe27ea90..9beb8e276ef 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -303,6 +303,6 @@ fn test_arena_destructors_fail() { // get freed too. do arena.alloc { @20 }; // Now fail. - die!(); + fail!(); }; } diff --git a/src/libstd/base64.rs b/src/libstd/base64.rs index d9e121798f1..10ea113f74e 100644 --- a/src/libstd/base64.rs +++ b/src/libstd/base64.rs @@ -63,7 +63,7 @@ impl &[u8]: ToBase64 { str::push_char(&mut s, chars[(n >> 6u) & 63u]); str::push_char(&mut s, '='); } - _ => die!(~"Algebra is broken, please alert the math police") + _ => fail!(~"Algebra is broken, please alert the math police") } } s @@ -82,7 +82,7 @@ pub trait FromBase64 { impl ~[u8]: FromBase64 { pure fn from_base64() -> ~[u8] { - if self.len() % 4u != 0u { die!(~"invalid base64 length"); } + if self.len() % 4u != 0u { fail!(~"invalid base64 length"); } let len = self.len(); let mut padding = 0u; @@ -124,10 +124,10 @@ impl ~[u8]: FromBase64 { r.push(((n >> 10u) & 0xFFu) as u8); return copy r; } - _ => die!(~"invalid base64 padding") + _ => fail!(~"invalid base64 padding") } } else { - die!(~"invalid base64 character"); + fail!(~"invalid base64 character"); } i += 1u; diff --git a/src/libstd/bigint.rs b/src/libstd/bigint.rs index 092a0d18a0f..2c713e58e9a 100644 --- a/src/libstd/bigint.rs +++ b/src/libstd/bigint.rs @@ -245,7 +245,7 @@ impl BigUint : Modulo<BigUint, BigUint> { } impl BigUint : Neg<BigUint> { - pure fn neg(&self) -> BigUint { die!() } + pure fn neg(&self) -> BigUint { fail!() } } impl BigUint : IntConvertible { @@ -332,7 +332,7 @@ pub impl BigUint { } pure fn divmod(&self, other: &BigUint) -> (BigUint, BigUint) { - if other.is_zero() { die!() } + if other.is_zero() { fail!() } if self.is_zero() { return (Zero::zero(), Zero::zero()); } if *other == One::one() { return (copy *self, Zero::zero()); } @@ -523,7 +523,7 @@ priv pure fn get_radix_base(radix: uint) -> (uint, uint) { 14 => (1475789056, 8), 15 => (2562890625, 8), 16 => (4294967296, 8), - _ => die!() + _ => fail!() } } @@ -547,7 +547,7 @@ priv pure fn get_radix_base(radix: uint) -> (uint, uint) { 14 => (38416, 4), 15 => (50625, 4), 16 => (65536, 4), - _ => die!() + _ => fail!() } } @@ -797,7 +797,7 @@ pub impl BigInt { let d = BigInt::from_biguint(Plus, d_ui), m = BigInt::from_biguint(Plus, m_ui); match (self.sign, other.sign) { - (_, Zero) => die!(), + (_, Zero) => fail!(), (Plus, Plus) | (Zero, Plus) => (d, m), (Plus, Minus) | (Zero, Minus) => if m.is_zero() { (-d, Zero::zero()) @@ -828,7 +828,7 @@ pub impl BigInt { let q = BigInt::from_biguint(Plus, q_ui); let r = BigInt::from_biguint(Plus, r_ui); match (self.sign, other.sign) { - (_, Zero) => die!(), + (_, Zero) => fail!(), (Plus, Plus) | (Zero, Plus) => ( q, r), (Plus, Minus) | (Zero, Minus) => (-q, r), (Minus, Plus) => (-q, -r), @@ -1193,7 +1193,7 @@ mod biguint_tests { ~"2" + str::from_chars(vec::from_elem(bits / 2 - 1, '0')) + "1"), (10, match bits { - 32 => ~"8589934593", 16 => ~"131073", _ => die!() + 32 => ~"8589934593", 16 => ~"131073", _ => fail!() }), (16, ~"2" + @@ -1210,7 +1210,7 @@ mod biguint_tests { (10, match bits { 32 => ~"55340232229718589441", 16 => ~"12885032961", - _ => die!() + _ => fail!() }), (16, ~"3" + str::from_chars(vec::from_elem(bits / 4 - 1, '0')) + "2" + @@ -1257,7 +1257,7 @@ mod biguint_tests { fn check(n: uint, s: &str) { let n = factor(n); let ans = match BigUint::from_str_radix(s, 10) { - Some(x) => x, None => die!() + Some(x) => x, None => fail!() }; assert n == ans; } diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index a94c4f79064..d62fb2e8f6e 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -240,7 +240,7 @@ pub fn Bitv (nbits: uint, init: bool) -> Bitv { priv impl Bitv { fn die() -> ! { - die!(~"Tried to do operation on bit vectors with different sizes"); + fail!(~"Tried to do operation on bit vectors with different sizes"); } #[inline(always)] @@ -985,7 +985,7 @@ mod tests { let b = Bitv(14, true); b.clear(); for b.ones |i| { - die!(fmt!("found 1 at %?", i)); + fail!(fmt!("found 1 at %?", i)); } } @@ -994,7 +994,7 @@ mod tests { let b = Bitv(140, true); b.clear(); for b.ones |i| { - die!(fmt!("found 1 at %?", i)); + fail!(fmt!("found 1 at %?", i)); } } } diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index 10a896a4089..f0ec3c1b9d7 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -32,7 +32,7 @@ impl<T> Cell<T> { /// Yields the value, failing if the cell is empty. fn take() -> T { if self.is_empty() { - die!(~"attempt to take an empty cell"); + fail!(~"attempt to take an empty cell"); } let mut value = None; @@ -43,7 +43,7 @@ impl<T> Cell<T> { /// Returns the value, failing if the cell is full. fn put_back(value: T) { if !self.is_empty() { - die!(~"attempt to put a value back into a full cell"); + fail!(~"attempt to put a value back into a full cell"); } self.value = Some(move value); } diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 465c5d8f8fe..7d819ba0b3f 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -57,7 +57,7 @@ pub fn create<T: Copy>() -> Deque<T> { move rv } fn get<T: Copy>(elts: &DVec<Cell<T>>, i: uint) -> T { - match (*elts).get_elt(i) { Some(move t) => t, _ => die!() } + match (*elts).get_elt(i) { Some(move t) => t, _ => fail!() } } struct Repr<T> { diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs index 768d2dbf2d4..c332c7656b4 100644 --- a/src/libstd/ebml.rs +++ b/src/libstd/ebml.rs @@ -107,7 +107,7 @@ pub mod reader { (data[start + 2u] as uint) << 8u | (data[start + 3u] as uint), next: start + 4u}; - } else { error!("vint too big"); die!(); } + } else { error!("vint too big"); fail!(); } } pub fn Doc(data: @~[u8]) -> Doc { @@ -143,7 +143,7 @@ pub mod reader { Some(d) => d, None => { error!("failed to find block with tag %u", tg); - die!(); + fail!(); } } } @@ -230,7 +230,7 @@ pub mod reader { self.pos = r_doc.end; let str = doc_as_str(r_doc); if lbl != str { - die!(fmt!("Expected label %s but found %s", lbl, + fail!(fmt!("Expected label %s but found %s", lbl, str)); } } @@ -240,7 +240,7 @@ pub mod reader { fn next_doc(exp_tag: EbmlEncoderTag) -> Doc { debug!(". next_doc(exp_tag=%?)", exp_tag); if self.pos >= self.parent.end { - die!(~"no more documents in current node!"); + fail!(~"no more documents in current node!"); } let TaggedDoc { tag: r_tag, doc: r_doc } = doc_at(self.parent.data, self.pos); @@ -248,11 +248,11 @@ pub mod reader { copy self.parent.start, copy self.parent.end, copy self.pos, r_tag, r_doc.start, r_doc.end); if r_tag != (exp_tag as uint) { - die!(fmt!("expected EBML doc with tag %? but found tag %?", + fail!(fmt!("expected EBML doc with tag %? but found tag %?", exp_tag, r_tag)); } if r_doc.end > self.parent.end { - die!(fmt!("invalid EBML, child extends to 0x%x, \ + fail!(fmt!("invalid EBML, child extends to 0x%x, \ parent to 0x%x", r_doc.end, self.parent.end)); } self.pos = r_doc.end; @@ -295,7 +295,7 @@ pub mod reader { fn read_uint(&self) -> uint { let v = doc_as_u64(self.next_doc(EsUint)); if v > (::core::uint::max_value as u64) { - die!(fmt!("uint %? too large for this architecture", v)); + fail!(fmt!("uint %? too large for this architecture", v)); } v as uint } @@ -307,7 +307,7 @@ pub mod reader { fn read_int(&self) -> int { let v = doc_as_u64(self.next_doc(EsInt)) as i64; if v > (int::max_value as i64) || v < (int::min_value as i64) { - die!(fmt!("int %? out of range for this architecture", v)); + fail!(fmt!("int %? out of range for this architecture", v)); } v as int } @@ -315,14 +315,14 @@ pub mod reader { fn read_bool(&self) -> bool { doc_as_u8(self.next_doc(EsBool)) as bool } - fn read_f64(&self) -> f64 { die!(~"read_f64()"); } - fn read_f32(&self) -> f32 { die!(~"read_f32()"); } - fn read_float(&self) -> float { die!(~"read_float()"); } + fn read_f64(&self) -> f64 { fail!(~"read_f64()"); } + fn read_f32(&self) -> f32 { fail!(~"read_f32()"); } + fn read_float(&self) -> float { fail!(~"read_float()"); } - fn read_char(&self) -> char { die!(~"read_char()"); } + fn read_char(&self) -> char { fail!(~"read_char()"); } fn read_owned_str(&self) -> ~str { doc_as_str(self.next_doc(EsStr)) } - fn read_managed_str(&self) -> @str { die!(~"read_managed_str()"); } + fn read_managed_str(&self) -> @str { fail!(~"read_managed_str()"); } // Compound types: fn read_owned<T>(&self, f: fn() -> T) -> T { @@ -431,7 +431,7 @@ pub mod writer { n as u8]), 4u => w.write(&[0x10u8 | ((n >> 24_u) as u8), (n >> 16_u) as u8, (n >> 8_u) as u8, n as u8]), - _ => die!(fmt!("vint to write too big: %?", n)) + _ => fail!(fmt!("vint to write too big: %?", n)) }; } @@ -440,7 +440,7 @@ pub mod writer { if n < 0x4000_u { write_sized_vuint(w, n, 2u); return; } if n < 0x200000_u { write_sized_vuint(w, n, 3u); return; } if n < 0x10000000_u { write_sized_vuint(w, n, 4u); return; } - die!(fmt!("vint to write too big: %?", n)); + fail!(fmt!("vint to write too big: %?", n)); } pub fn Encoder(w: io::Writer) -> Encoder { @@ -602,17 +602,17 @@ pub mod writer { // FIXME (#2742): implement these fn emit_f64(&self, _v: f64) { - die!(~"Unimplemented: serializing an f64"); + fail!(~"Unimplemented: serializing an f64"); } fn emit_f32(&self, _v: f32) { - die!(~"Unimplemented: serializing an f32"); + fail!(~"Unimplemented: serializing an f32"); } fn emit_float(&self, _v: float) { - die!(~"Unimplemented: serializing a float"); + fail!(~"Unimplemented: serializing a float"); } fn emit_char(&self, _v: char) { - die!(~"Unimplemented: serializing a char"); + fail!(~"Unimplemented: serializing a char"); } fn emit_borrowed_str(&self, v: &str) { diff --git a/src/libstd/flatpipes.rs b/src/libstd/flatpipes.rs index ba95fa5b661..a7507a971c8 100644 --- a/src/libstd/flatpipes.rs +++ b/src/libstd/flatpipes.rs @@ -262,7 +262,7 @@ pub impl<T,U:Unflattener<T>,P:BytePort> FlatPort<T, U, P>: GenericPort<T> { fn recv() -> T { match self.try_recv() { Some(move val) => move val, - None => die!(~"port is closed") + None => fail!(~"port is closed") } } fn try_recv() -> Option<T> { @@ -298,7 +298,7 @@ pub impl<T,U:Unflattener<T>,P:BytePort> FlatPort<T, U, P>: GenericPort<T> { } } else { - die!(~"flatpipe: unrecognized command"); + fail!(~"flatpipe: unrecognized command"); } } } @@ -480,7 +480,7 @@ pub mod flatteners { Ok(move json) => { json::Decoder(move json) } - Err(e) => die!(fmt!("flatpipe: can't parse json: %?", e)) + Err(e) => fail!(fmt!("flatpipe: can't parse json: %?", e)) } } } diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 57b768a742f..ec71c30242c 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -65,14 +65,14 @@ impl<A> Future<A> { unsafe { match self.state { Forced(ref mut v) => { return cast::transmute(v); } - Evaluating => die!(~"Recursive forcing of future!"), + Evaluating => fail!(~"Recursive forcing of future!"), Pending(_) => {} } let mut state = Evaluating; self.state <-> state; match move state { - Forced(_) | Evaluating => die!(~"Logic error."), + Forced(_) | Evaluating => fail!(~"Logic error."), Pending(move f) => { self.state = Forced(move f()); self.get_ref() @@ -195,7 +195,7 @@ pub mod test { #[should_fail] #[ignore(cfg(target_os = "win32"))] pub fn test_futurefail() { - let f = spawn(|| die!()); + let f = spawn(|| fail!()); let _x: ~str = f.get(); } diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index e3f8ef1b2b5..3d6d0b1bb7d 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -349,7 +349,7 @@ fn opt_vals(mm: &Matches, nm: &str) -> ~[Optval] { Some(id) => mm.vals[id], None => { error!("No option '%s' defined", nm); - die!() + fail!() } }; } @@ -385,7 +385,7 @@ pub fn opts_present(mm: &Matches, names: &[~str]) -> bool { * argument */ pub fn opt_str(mm: &Matches, nm: &str) -> ~str { - return match opt_val(mm, nm) { Val(copy s) => s, _ => die!() }; + return match opt_val(mm, nm) { Val(copy s) => s, _ => fail!() }; } /** @@ -401,7 +401,7 @@ pub fn opts_str(mm: &Matches, names: &[~str]) -> ~str { _ => () } } - die!(); + fail!(); } @@ -551,7 +551,7 @@ pub mod groups { match ((*lopt).short_name.len(), (*lopt).long_name.len()) { - (0,0) => die!(~"this long-format option was given no name"), + (0,0) => fail!(~"this long-format option was given no name"), (0,_) => ~[Opt {name: Long(((*lopt).long_name)), hasarg: (*lopt).hasarg, @@ -568,7 +568,7 @@ pub mod groups { hasarg: (*lopt).hasarg, occur: (*lopt).occur}], - (_,_) => die!(~"something is wrong with the long-form opt") + (_,_) => fail!(~"something is wrong with the long-form opt") } } @@ -599,7 +599,7 @@ pub mod groups { row += match short_name.len() { 0 => ~"", 1 => ~"-" + short_name + " ", - _ => die!(~"the short name should only be 1 char long"), + _ => fail!(~"the short name should only be 1 char long"), }; // long option @@ -669,7 +669,7 @@ mod tests { assert (opt_present(m, ~"test")); assert (opt_str(m, ~"test") == ~"20"); } - _ => { die!(~"test_reqopt_long failed"); } + _ => { fail!(~"test_reqopt_long failed"); } } } @@ -680,7 +680,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionMissing_), - _ => die!() + _ => fail!() } } @@ -691,7 +691,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -702,7 +702,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -716,7 +716,7 @@ mod tests { assert (opt_present(m, ~"t")); assert (opt_str(m, ~"t") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -727,7 +727,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionMissing_), - _ => die!() + _ => fail!() } } @@ -738,7 +738,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -749,7 +749,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -765,7 +765,7 @@ mod tests { assert (opt_present(m, ~"test")); assert (opt_str(m, ~"test") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -776,7 +776,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"test")), - _ => die!() + _ => fail!() } } @@ -787,7 +787,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -798,7 +798,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -812,7 +812,7 @@ mod tests { assert (opt_present(m, ~"t")); assert (opt_str(m, ~"t") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -823,7 +823,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"t")), - _ => die!() + _ => fail!() } } @@ -834,7 +834,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -845,7 +845,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -858,7 +858,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (opt_present(m, ~"test")), - _ => die!() + _ => fail!() } } @@ -869,7 +869,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"test")), - _ => die!() + _ => fail!() } } @@ -883,7 +883,7 @@ mod tests { log(error, fail_str(f)); check_fail_type(f, UnexpectedArgument_); } - _ => die!() + _ => fail!() } } @@ -894,7 +894,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -905,7 +905,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (opt_present(m, ~"t")), - _ => die!() + _ => fail!() } } @@ -916,7 +916,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"t")), - _ => die!() + _ => fail!() } } @@ -931,7 +931,7 @@ mod tests { assert (m.free[0] == ~"20"); } - _ => die!() + _ => fail!() } } @@ -942,7 +942,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, OptionDuplicated_), - _ => die!() + _ => fail!() } } @@ -956,7 +956,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"v") == 1); } - _ => die!() + _ => fail!() } } @@ -969,7 +969,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"v") == 2); } - _ => die!() + _ => fail!() } } @@ -982,7 +982,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"v") == 2); } - _ => die!() + _ => fail!() } } @@ -995,7 +995,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"verbose") == 1); } - _ => die!() + _ => fail!() } } @@ -1008,7 +1008,7 @@ mod tests { Ok(ref m) => { assert (opt_count(m, ~"verbose") == 2); } - _ => die!() + _ => fail!() } } @@ -1023,7 +1023,7 @@ mod tests { assert (opt_present(m, ~"test")); assert (opt_str(m, ~"test") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -1034,7 +1034,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"test")), - _ => die!() + _ => fail!() } } @@ -1045,7 +1045,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -1062,7 +1062,7 @@ mod tests { assert (pair[0] == ~"20"); assert (pair[1] == ~"30"); } - _ => die!() + _ => fail!() } } @@ -1076,7 +1076,7 @@ mod tests { assert (opt_present(m, ~"t")); assert (opt_str(m, ~"t") == ~"20"); } - _ => die!() + _ => fail!() } } @@ -1087,7 +1087,7 @@ mod tests { let rs = getopts(args, opts); match rs { Ok(ref m) => assert (!opt_present(m, ~"t")), - _ => die!() + _ => fail!() } } @@ -1098,7 +1098,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, ArgumentMissing_), - _ => die!() + _ => fail!() } } @@ -1115,7 +1115,7 @@ mod tests { assert (pair[0] == ~"20"); assert (pair[1] == ~"30"); } - _ => die!() + _ => fail!() } } @@ -1126,7 +1126,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, UnrecognizedOption_), - _ => die!() + _ => fail!() } } @@ -1137,7 +1137,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => check_fail_type(f, UnrecognizedOption_), - _ => die!() + _ => fail!() } } @@ -1169,7 +1169,7 @@ mod tests { assert (pair[1] == ~"-60 70"); assert (!opt_present(m, ~"notpresent")); } - _ => die!() + _ => fail!() } } @@ -1179,7 +1179,7 @@ mod tests { let opts = ~[optopt(~"e"), optopt(~"encrypt")]; let matches = &match getopts(args, opts) { result::Ok(move m) => m, - result::Err(_) => die!() + result::Err(_) => fail!() }; assert opts_present(matches, ~[~"e"]); assert opts_present(matches, ~[~"encrypt"]); @@ -1200,7 +1200,7 @@ mod tests { let opts = ~[optmulti(~"L"), optmulti(~"M")]; let matches = &match getopts(args, opts) { result::Ok(move m) => m, - result::Err(_) => die!() + result::Err(_) => fail!() }; assert opts_present(matches, ~[~"L"]); assert opts_str(matches, ~[~"L"]) == ~"foo"; diff --git a/src/libstd/json.rs b/src/libstd/json.rs index d5ad2f7fce7..95f9130fa37 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -257,7 +257,7 @@ pub impl PrettyEncoder: serialize::Encoder { fn emit_managed(&self, f: fn()) { f() } fn emit_enum(&self, name: &str, f: fn()) { - if name != "option" { die!(~"only supports option enum") } + if name != "option" { fail!(~"only supports option enum") } f() } fn emit_enum_variant(&self, _name: &str, id: uint, _cnt: uint, f: fn()) { @@ -773,7 +773,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_nil"); match *self.pop() { Null => (), - _ => die!(~"not a null") + _ => fail!(~"not a null") } } @@ -793,7 +793,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_bool"); match *self.pop() { Boolean(b) => b, - _ => die!(~"not a boolean") + _ => fail!(~"not a boolean") } } @@ -803,13 +803,13 @@ pub impl Decoder: serialize::Decoder { debug!("read_float"); match *self.pop() { Number(f) => f, - _ => die!(~"not a number") + _ => fail!(~"not a number") } } fn read_char(&self) -> char { let v = str::chars(self.read_owned_str()); - if v.len() != 1 { die!(~"string must have one character") } + if v.len() != 1 { fail!(~"string must have one character") } v[0] } @@ -817,7 +817,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_owned_str"); match *self.pop() { String(ref s) => copy *s, - _ => die!(~"not a string") + _ => fail!(~"not a string") } } @@ -825,7 +825,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_managed_str"); match *self.pop() { String(ref s) => s.to_managed(), - _ => die!(~"not a string") + _ => fail!(~"not a string") } } @@ -841,7 +841,7 @@ pub impl Decoder: serialize::Decoder { fn read_enum<T>(&self, name: &str, f: fn() -> T) -> T { debug!("read_enum(%s)", name); - if name != ~"option" { die!(~"only supports the option enum") } + if name != ~"option" { fail!(~"only supports the option enum") } f() } @@ -856,7 +856,7 @@ pub impl Decoder: serialize::Decoder { fn read_enum_variant_arg<T>(&self, idx: uint, f: fn() -> T) -> T { debug!("read_enum_variant_arg(idx=%u)", idx); - if idx != 0 { die!(~"unknown index") } + if idx != 0 { fail!(~"unknown index") } f() } @@ -864,7 +864,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_owned_vec()"); let len = match *self.peek() { List(ref list) => list.len(), - _ => die!(~"not a list"), + _ => fail!(~"not a list"), }; let res = f(len); self.pop(); @@ -875,7 +875,7 @@ pub impl Decoder: serialize::Decoder { debug!("read_owned_vec()"); let len = match *self.peek() { List(ref list) => list.len(), - _ => die!(~"not a list"), + _ => fail!(~"not a list"), }; let res = f(len); self.pop(); @@ -889,7 +889,7 @@ pub impl Decoder: serialize::Decoder { self.stack.push(&list[idx]); f() } - _ => die!(~"not a list"), + _ => fail!(~"not a list"), } } @@ -913,20 +913,20 @@ pub impl Decoder: serialize::Decoder { match *top { Object(ref obj) => { match obj.find(&name.to_owned()) { - None => die!(fmt!("no such field: %s", name)), + None => fail!(fmt!("no such field: %s", name)), Some(json) => { self.stack.push(json); f() } } } - Number(_) => die!(~"num"), - String(_) => die!(~"str"), - Boolean(_) => die!(~"bool"), - List(_) => die!(fmt!("list: %?", top)), - Null => die!(~"null"), + Number(_) => fail!(~"num"), + String(_) => fail!(~"str"), + Boolean(_) => fail!(~"bool"), + List(_) => fail!(fmt!("list: %?", top)), + Null => fail!(~"null"), - //_ => die!(fmt!("not an object: %?", *top)) + //_ => fail!(fmt!("not an object: %?", *top)) } } @@ -944,7 +944,7 @@ pub impl Decoder: serialize::Decoder { self.stack.push(&list[idx]); f() } - _ => die!(~"not a list") + _ => fail!(~"not a list") } } } diff --git a/src/libstd/list.rs b/src/libstd/list.rs index 140c2013738..5feac4ad454 100644 --- a/src/libstd/list.rs +++ b/src/libstd/list.rs @@ -93,7 +93,7 @@ pub pure fn len<T>(ls: @List<T>) -> uint { pub pure fn tail<T: Copy>(ls: @List<T>) -> @List<T> { match *ls { Cons(_, tl) => return tl, - Nil => die!(~"list empty") + Nil => fail!(~"list empty") } } @@ -102,7 +102,7 @@ pub pure fn head<T: Copy>(ls: @List<T>) -> T { match *ls { Cons(copy hd, _) => hd, // makes me sad - _ => die!(~"head invoked on empty list") + _ => fail!(~"head invoked on empty list") } } diff --git a/src/libstd/net_ip.rs b/src/libstd/net_ip.rs index 511e80b0160..2f423f4c8d4 100644 --- a/src/libstd/net_ip.rs +++ b/src/libstd/net_ip.rs @@ -63,14 +63,14 @@ pub fn format_addr(ip: &IpAddr) -> ~str { Ipv4(ref addr) => unsafe { let result = uv_ip4_name(addr); if result == ~"" { - die!(~"failed to convert inner sockaddr_in address to str") + fail!(~"failed to convert inner sockaddr_in address to str") } result }, Ipv6(ref addr) => unsafe { let result = uv_ip6_name(addr); if result == ~"" { - die!(~"failed to convert inner sockaddr_in address to str") + fail!(~"failed to convert inner sockaddr_in address to str") } result } @@ -182,7 +182,7 @@ pub mod v4 { pub fn parse_addr(ip: &str) -> IpAddr { match try_parse_addr(ip) { result::Ok(move addr) => move addr, - result::Err(ref err_data) => die!(err_data.err_msg) + result::Err(ref err_data) => fail!(err_data.err_msg) } } // the simple, old style numberic representation of @@ -277,7 +277,7 @@ pub mod v6 { pub fn parse_addr(ip: &str) -> IpAddr { match try_parse_addr(ip) { result::Ok(move addr) => move addr, - result::Err(copy err_data) => die!(err_data.err_msg) + result::Err(copy err_data) => fail!(err_data.err_msg) } } pub fn try_parse_addr(ip: &str) -> result::Result<IpAddr,ParseAddrErr> { @@ -399,7 +399,7 @@ mod test { assert true; } result::Ok(ref addr) => { - die!(fmt!("Expected failure, but got addr %?", addr)); + fail!(fmt!("Expected failure, but got addr %?", addr)); } } } @@ -412,7 +412,7 @@ mod test { assert true; } result::Ok(ref addr) => { - die!(fmt!("Expected failure, but got addr %?", addr)); + fail!(fmt!("Expected failure, but got addr %?", addr)); } } } @@ -423,7 +423,7 @@ mod test { let iotask = &uv::global_loop::get(); let ga_result = get_addr(localhost_name, iotask); if result::is_err(&ga_result) { - die!(~"got err result from net::ip::get_addr();") + fail!(~"got err result from net::ip::get_addr();") } // note really sure how to realiably test/assert // this.. mostly just wanting to see it work, atm. diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index c90518f1692..8addea9c30b 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -941,7 +941,7 @@ impl TcpSocketBuf: io::Reader { } else { debug!("ERROR sock_buf as io::reader.read err %? %?", err_data.err_name, err_data.err_msg); - die!() + fail!() } } else { @@ -1645,7 +1645,7 @@ pub mod test { hl_loop); match actual_resp_result.get_err() { ConnectionRefused => (), - _ => die!(~"unknown error.. expected connection_refused") + _ => fail!(~"unknown error.. expected connection_refused") } } pub fn impl_gl_tcp_ipv4_server_address_in_use() { @@ -1686,7 +1686,7 @@ pub mod test { assert true; } _ => { - die!(~"expected address_in_use listen error,"+ + fail!(~"expected address_in_use listen error,"+ ~"but got a different error varient. check logs."); } } @@ -1705,7 +1705,7 @@ pub mod test { assert true; } _ => { - die!(~"expected address_in_use listen error,"+ + fail!(~"expected address_in_use listen error,"+ ~"but got a different error varient. check logs."); } } @@ -1885,14 +1885,14 @@ pub mod test { if result::is_err(&listen_result) { match result::get_err(&listen_result) { GenericListenErr(ref name, ref msg) => { - die!(fmt!("SERVER: exited abnormally name %s msg %s", + fail!(fmt!("SERVER: exited abnormally name %s msg %s", *name, *msg)); } AccessDenied => { - die!(~"SERVER: exited abnormally, got access denied.."); + fail!(~"SERVER: exited abnormally, got access denied.."); } AddressInUse => { - die!(~"SERVER: exited abnormally, got address in use..."); + fail!(~"SERVER: exited abnormally, got address in use..."); } } } @@ -1911,7 +1911,7 @@ pub mod test { debug!("establish_cb %?", kill_ch); }, |new_conn, kill_ch| { - die!(fmt!("SERVER: shouldn't be called.. %? %?", + fail!(fmt!("SERVER: shouldn't be called.. %? %?", new_conn, kill_ch)); }); // err check on listen_result @@ -1919,7 +1919,7 @@ pub mod test { result::get_err(&listen_result) } else { - die!(~"SERVER: did not fail as expected") + fail!(~"SERVER: did not fail as expected") } } @@ -1963,7 +1963,7 @@ pub mod test { debug!("tcp_write_single err name: %s msg: %s", err_data.err_name, err_data.err_msg); // meh. torn on what to do here. - die!(~"tcp_write_single failed"); + fail!(~"tcp_write_single failed"); } } } diff --git a/src/libstd/oldmap.rs b/src/libstd/oldmap.rs index cea6d17e35d..900b7068ce3 100644 --- a/src/libstd/oldmap.rs +++ b/src/libstd/oldmap.rs @@ -319,7 +319,7 @@ pub mod chained { pure fn get(&self, k: &K) -> V { let opt_v = self.find(k); if opt_v.is_none() { - die!(fmt!("Key not found in table: %?", k)); + fail!(fmt!("Key not found in table: %?", k)); } option::unwrap(move opt_v) } diff --git a/src/libstd/oldsmallintmap.rs b/src/libstd/oldsmallintmap.rs index 803e75e4cf7..c9e739e3c8b 100644 --- a/src/libstd/oldsmallintmap.rs +++ b/src/libstd/oldsmallintmap.rs @@ -67,7 +67,7 @@ pub pure fn get<T: Copy>(self: SmallIntMap<T>, key: uint) -> T { match find(self, key) { None => { error!("smallintmap::get(): key not present"); - die!(); + fail!(); } Some(move v) => return v } diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs index dbfa771e0a2..8ff90b940fb 100644 --- a/src/libstd/rope.rs +++ b/src/libstd/rope.rs @@ -98,7 +98,7 @@ pub fn of_str(str: @~str) -> Rope { */ pub fn of_substr(str: @~str, byte_offset: uint, byte_len: uint) -> Rope { if byte_len == 0u { return node::Empty; } - if byte_offset + byte_len > str::len(*str) { die!(); } + if byte_offset + byte_len > str::len(*str) { fail!(); } return node::Content(node::of_substr(str, byte_offset, byte_len)); } @@ -244,9 +244,9 @@ Section: Transforming ropes pub fn sub_chars(rope: Rope, char_offset: uint, char_len: uint) -> Rope { if char_len == 0u { return node::Empty; } match (rope) { - node::Empty => die!(), + node::Empty => fail!(), node::Content(node) => if char_len > node::char_len(node) { - die!() + fail!() } else { return node::Content(node::sub_chars(node, char_offset, char_len)) } @@ -269,9 +269,9 @@ pub fn sub_chars(rope: Rope, char_offset: uint, char_len: uint) -> Rope { pub fn sub_bytes(rope: Rope, byte_offset: uint, byte_len: uint) -> Rope { if byte_len == 0u { return node::Empty; } match (rope) { - node::Empty => die!(), + node::Empty => fail!(), node::Content(node) =>if byte_len > node::byte_len(node) { - die!() + fail!() } else { return node::Content(node::sub_bytes(node, byte_offset, byte_len)) } @@ -548,7 +548,7 @@ pub pure fn byte_len(rope: Rope) -> uint { */ pub fn char_at(rope: Rope, pos: uint) -> char { match (rope) { - node::Empty => die!(), + node::Empty => fail!(), node::Content(x) => return node::char_at(x, pos) } } diff --git a/src/libstd/serialize.rs b/src/libstd/serialize.rs index 972df73d216..d4afdbf6f30 100644 --- a/src/libstd/serialize.rs +++ b/src/libstd/serialize.rs @@ -389,7 +389,7 @@ pub impl<D: Decoder, T: Decodable<D>> Option<T>: Decodable<D> { 0 => None, 1 => Some(d.read_enum_variant_arg( 0u, || Decodable::decode(d))), - _ => die!(fmt!("Bad variant for option: %u", i)) + _ => fail!(fmt!("Bad variant for option: %u", i)) } } } diff --git a/src/libstd/sha1.rs b/src/libstd/sha1.rs index 788d1d1012d..e89f3787830 100644 --- a/src/libstd/sha1.rs +++ b/src/libstd/sha1.rs @@ -83,7 +83,7 @@ pub fn sha1() -> Sha1 { st.len_high += 1u32; if st.len_high == 0u32 { // FIXME: Need better failure mode (#2346) - die!(); + fail!(); } } if st.msg_block_idx == msg_block_len { process_msg_block(st); } diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs index 9c7d31e15f3..f8acbe84180 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -546,7 +546,7 @@ impl<T: Copy Ord> MergeState<T> { copy_vec(array, dest, array, c2, len2); array[dest+len2] <-> tmp[c1]; } else if len1 == 0 { - die!(~"Comparison violates its contract!"); + fail!(~"Comparison violates its contract!"); } else { assert len2 == 0; assert len1 > 1; @@ -664,7 +664,7 @@ impl<T: Copy Ord> MergeState<T> { copy_vec(array, dest+1, array, c1+1, len1); array[dest] <-> tmp[c2]; } else if len2 == 0 { - die!(~"Comparison violates its contract!"); + fail!(~"Comparison violates its contract!"); } else { assert len1 == 0; assert len2 != 0; @@ -912,7 +912,7 @@ mod test_tim_sort { pure fn lt(&self, other: &CVal) -> bool { unsafe { let rng = rand::Rng(); - if rng.gen_float() > 0.995 { die!(~"It's happening!!!"); } + if rng.gen_float() > 0.995 { fail!(~"It's happening!!!"); } } (*self).val < other.val } @@ -968,7 +968,7 @@ mod test_tim_sort { }; tim_sort(arr); - die!(~"Guarantee the fail"); + fail!(~"Guarantee the fail"); } struct DVal { val: uint } @@ -1036,7 +1036,7 @@ mod big_tests { fn isSorted<T: Ord>(arr: &[const T]) { for uint::range(0, arr.len()-1) |i| { if arr[i] > arr[i+1] { - die!(~"Array not sorted"); + fail!(~"Array not sorted"); } } } @@ -1108,7 +1108,7 @@ mod big_tests { fn isSorted<T: Ord>(arr: &[const @T]) { for uint::range(0, arr.len()-1) |i| { if arr[i] > arr[i+1] { - die!(~"Array not sorted"); + fail!(~"Array not sorted"); } } } @@ -1191,7 +1191,7 @@ mod big_tests { task::local_data::local_data_set(self.key, @(y+1)); } } - _ => die!(~"Expected key to work"), + _ => fail!(~"Expected key to work"), } } } diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index b7e75897bf1..8a5741201c0 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -333,10 +333,10 @@ fn check_cvar_bounds<U>(out_of_bounds: Option<uint>, id: uint, act: &str, blk: fn() -> U) -> U { match out_of_bounds { Some(0) => - die!(fmt!("%s with illegal ID %u - this lock has no condvars!", + fail!(fmt!("%s with illegal ID %u - this lock has no condvars!", act, id)), Some(length) => - die!(fmt!("%s with illegal ID %u - ID must be less than %u", + fail!(fmt!("%s with illegal ID %u - ID must be less than %u", act, id, length)), None => blk() } @@ -580,7 +580,7 @@ impl &RWlock { /// To be called inside of the write_downgrade block. fn downgrade(token: RWlockWriteMode/&a) -> RWlockReadMode/&a { if !ptr::ref_eq(self, token.lock) { - die!(~"Can't downgrade() with a different rwlock's write_mode!"); + fail!(~"Can't downgrade() with a different rwlock's write_mode!"); } unsafe { do task::unkillable { @@ -933,7 +933,7 @@ mod tests { let result: result::Result<(),()> = do task::try |move m2| { do m2.lock { - die!(); + fail!(); } }; assert result.is_err(); @@ -952,7 +952,7 @@ mod tests { do task::spawn |move p| { // linked let _ = p.recv(); // wait for sibling to get in the mutex task::yield(); - die!(); + fail!(); } do m2.lock_cond |cond| { c.send(()); // tell sibling go ahead @@ -994,7 +994,7 @@ mod tests { } do m2.lock { } c.send(move sibling_convos); // let parent wait on all children - die!(); + fail!(); }; assert result.is_err(); // child task must have finished by the time try returns @@ -1048,7 +1048,7 @@ mod tests { let _ = p.recv(); do m.lock_cond |cond| { if !cond.signal_on(0) { - die!(); // success; punt sibling awake. + fail!(); // success; punt sibling awake. } } }; @@ -1288,7 +1288,7 @@ mod tests { let result: result::Result<(),()> = do task::try |move x2| { do lock_rwlock_in_mode(x2, mode1) { - die!(); + fail!(); } }; assert result.is_err(); diff --git a/src/libstd/test.rs b/src/libstd/test.rs index f3e96826a8e..530761e48a2 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -121,9 +121,9 @@ pub fn test_main(args: &[~str], tests: ~[TestDescAndFn]) { let opts = match parse_opts(args) { either::Left(move o) => o, - either::Right(move m) => die!(m) + either::Right(move m) => fail!(m) }; - if !run_tests_console(&opts, tests) { die!(~"Some tests failed"); } + if !run_tests_console(&opts, tests) { fail!(~"Some tests failed"); } } // A variant optimized for invocation with a static test vector. @@ -284,7 +284,7 @@ pub fn run_tests_console(opts: &TestOpts, io::Truncate]) { result::Ok(w) => Some(w), result::Err(ref s) => { - die!(fmt!("can't open output file: %s", *s)) + fail!(fmt!("can't open output file: %s", *s)) } }, None => None @@ -800,7 +800,7 @@ mod tests { #[test] pub fn do_not_run_ignored_tests() { - fn f() { die!(); } + fn f() { fail!(); } let desc = TestDescAndFn { desc: TestDesc { name: StaticTestName("whatever"), @@ -837,7 +837,7 @@ mod tests { #[test] #[ignore(cfg(windows))] pub fn test_should_fail() { - fn f() { die!(); } + fn f() { fail!(); } let desc = TestDescAndFn { desc: TestDesc { name: StaticTestName("whatever"), @@ -876,7 +876,7 @@ mod tests { let args = ~[~"progname", ~"filter"]; let opts = match parse_opts(args) { either::Left(copy o) => o, - _ => die!(~"Malformed arg in first_free_arg_should_be_a_filter") + _ => fail!(~"Malformed arg in first_free_arg_should_be_a_filter") }; assert ~"filter" == opts.filter.get(); } @@ -886,7 +886,7 @@ mod tests { let args = ~[~"progname", ~"filter", ~"--ignored"]; let opts = match parse_opts(args) { either::Left(copy o) => o, - _ => die!(~"Malformed arg in parse_ignored_flag") + _ => fail!(~"Malformed arg in parse_ignored_flag") }; assert (opts.run_ignored); } diff --git a/src/libstd/time.rs b/src/libstd/time.rs index f696d239d30..622e1ea65d8 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -1040,7 +1040,7 @@ mod tests { == Err(~"Invalid time"); match strptime(~"Fri Feb 13 15:31:30 2009", format) { - Err(copy e) => die!(e), + Err(copy e) => fail!(e), Ok(ref tm) => { assert tm.tm_sec == 30_i32; assert tm.tm_min == 31_i32; @@ -1060,7 +1060,7 @@ mod tests { fn test(s: &str, format: &str) -> bool { match strptime(s, format) { Ok(ref tm) => tm.strftime(format) == str::from_slice(s), - Err(copy e) => die!(e) + Err(copy e) => fail!(e) } } diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs index 1da1bc60314..6e1e6a331a2 100644 --- a/src/libstd/timer.rs +++ b/src/libstd/timer.rs @@ -67,12 +67,12 @@ pub fn delayed_send<T: Owned>(iotask: &IoTask, } else { let error_msg = uv::ll::get_last_err_info( loop_ptr); - die!(~"timer::delayed_send() start failed: " + + fail!(~"timer::delayed_send() start failed: " + error_msg); } } else { let error_msg = uv::ll::get_last_err_info(loop_ptr); - die!(~"timer::delayed_send() init failed: " + + fail!(~"timer::delayed_send() init failed: " + error_msg); } } @@ -157,7 +157,7 @@ extern fn delayed_send_cb(handle: *uv::ll::uv_timer_t, } else { let loop_ptr = uv::ll::get_loop_for_uv_handle(handle); let error_msg = uv::ll::get_last_err_info(loop_ptr); - die!(~"timer::sleep() init failed: "+error_msg); + fail!(~"timer::sleep() init failed: "+error_msg); } } } diff --git a/src/libstd/uv_global_loop.rs b/src/libstd/uv_global_loop.rs index 9763f655a6f..6621eef8b0b 100644 --- a/src/libstd/uv_global_loop.rs +++ b/src/libstd/uv_global_loop.rs @@ -184,11 +184,11 @@ mod test { simple_timer_cb, 1u, 0u); if(start_status != 0i32) { - die!(~"failure on ll::timer_start()"); + fail!(~"failure on ll::timer_start()"); } } else { - die!(~"failure on ll::timer_init()"); + fail!(~"failure on ll::timer_init()"); } } }; diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index 69116ace9e8..d78761b70e3 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -382,7 +382,7 @@ fn unwrap<T:Owned ww.res <-> s; match move s { - None => die!(), + None => fail!(), Some(Left(move v)) => move v, Some(Right(move port)) => { |
