Skip to content

Commit

Permalink
Remove all final references to die!
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Desaulniers committed Feb 14, 2013
1 parent 36edd25 commit 4699ac6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/libcore/hashmap.rs
Expand Up @@ -159,7 +159,7 @@ pub mod linear {
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"),
}
}

Expand Down Expand Up @@ -373,7 +373,7 @@ pub mod linear {

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,
Expand Down Expand Up @@ -403,7 +403,7 @@ pub mod linear {

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);
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/os.rs
Expand Up @@ -849,7 +849,7 @@ pub fn last_os_error() -> ~str {
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])
Expand Down Expand Up @@ -887,7 +887,7 @@ pub fn last_os_error() -> ~str {
&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])
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/json.rs
Expand Up @@ -1284,13 +1284,13 @@ mod tests {
// 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));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/test.rs
Expand Up @@ -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");
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs
Expand Up @@ -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();
Expand Down
Expand Up @@ -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();
Expand Down

5 comments on commit 4699ac6

@bors
Copy link
Contributor

@bors bors commented on 4699ac6 Feb 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at nickdesaulniers@4699ac6

@bors
Copy link
Contributor

@bors bors commented on 4699ac6 Feb 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging nickdesaulniers/rust/issue4524cleanup = 4699ac6 into auto

@bors
Copy link
Contributor

@bors bors commented on 4699ac6 Feb 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nickdesaulniers/rust/issue4524cleanup = 4699ac6 merged ok, testing candidate = 3c07d03

@bors
Copy link
Contributor

@bors bors commented on 4699ac6 Feb 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 4699ac6 Feb 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 3c07d03

Please sign in to comment.