auto merge of #4934 : nickdesaulniers/rust/issue4524cleanup, r=brson

review? @brson
Issue #4524
This commit is contained in:
bors
2013-02-14 15:37:48 -08:00
6 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -159,7 +159,7 @@ fn insert_opt_bucket(&mut self, bucket: Option<Bucket<K, V>>) {
pure fn value_for_bucket(&self, idx: uint) -> &self/V {
match self.buckets[idx] {
Some(ref bkt) => &bkt.value,
None => die!(~"LinearMap::find: internal logic error"),
None => fail!(~"LinearMap::find: internal logic error"),
}
}
@@ -373,7 +373,7 @@ fn find_or_insert(&mut self, k: K, v: V) -> &self/V {
let hash = k.hash_keyed(self.k0, self.k1) as uint;
let idx = match self.bucket_for_key_with_hash(hash, &k) {
TableFull => die!(~"Internal logic error"),
TableFull => fail!(~"Internal logic error"),
FoundEntry(idx) => idx,
FoundHole(idx) => {
self.buckets[idx] = Some(Bucket{hash: hash, key: k,
@@ -403,7 +403,7 @@ fn find_or_insert_with(&mut self, k: K, f: fn(&K) -> V) -> &self/V {
let hash = k.hash_keyed(self.k0, self.k1) as uint;
let idx = match self.bucket_for_key_with_hash(hash, &k) {
TableFull => die!(~"Internal logic error"),
TableFull => fail!(~"Internal logic error"),
FoundEntry(idx) => idx,
FoundHole(idx) => {
let v = f(&k);
+2 -2
View File
@@ -849,7 +849,7 @@ unsafe fn __xpg_strerror_r(errnum: c_int, buf: *c_char,
let err = strerror_r(errno() as c_int, &buf[0],
TMPBUF_SZ as size_t);
if err < 0 {
die!(~"strerror_r failure");
fail!(~"strerror_r failure");
}
str::raw::from_c_str(&buf[0])
@@ -887,7 +887,7 @@ unsafe fn FormatMessageA(flags: DWORD, lpSrc: LPVOID,
&mut buf[0], TMPBUF_SZ as DWORD,
ptr::null());
if res == 0 {
die!(fmt!("[%?] FormatMessage failure", errno()));
fail!(fmt!("[%?] FormatMessage failure", errno()));
}
str::raw::from_c_str(&buf[0])
+2 -2
View File
@@ -1284,13 +1284,13 @@ fn test_write_object() {
// Should they be in their own crate?
pub pure fn check_equal_ptr<T : cmp::Eq> (given : &T, expected: &T) {
if !((given == expected) && (expected == given )) {
die!(fmt!("given %?, expected %?",given,expected));
fail!(fmt!("given %?, expected %?",given,expected));
}
}
pub pure fn check_equal<T : cmp::Eq> (given : T, expected: T) {
if !((given == expected) && (expected == given )) {
die!(fmt!("given %?, expected %?",given,expected));
fail!(fmt!("given %?, expected %?",given,expected));
}
}
+1 -1
View File
@@ -143,7 +143,7 @@ pub fn test_main_static(args: &[~str], tests: &[TestDescAndFn]) {
TestDescAndFn { testfn: StaticBenchFn(f), desc: copy t.desc },
_ => {
die! (~"non-static tests passed to test::test_main_static");
fail!(~"non-static tests passed to test::test_main_static");
}
}
};
@@ -18,7 +18,7 @@ struct Bar {
int2: int,
}
fn make_foo() -> ~Foo { die!() }
fn make_foo() -> ~Foo { fail!() }
fn borrow_same_field_twice_mut_mut() {
let mut foo = make_foo();
@@ -18,7 +18,7 @@ struct Bar {
int2: int,
}
fn make_foo() -> Foo { die!() }
fn make_foo() -> Foo { fail!() }
fn borrow_same_field_twice_mut_mut() {
let mut foo = make_foo();