Revert "Remove usages of case(_) { fail; } since the compiler does this automatically". When we have exhaustiveness checking, "case(_) { fail; }" will be useful to silence warnings.

This reverts commit 92a716d862.
This commit is contained in:
Patrick Walton 2011-03-22 14:02:52 -07:00
parent 6623597c18
commit bcf04e253f
4 changed files with 11 additions and 0 deletions

View file

@ -47,6 +47,7 @@ fn create[T]() -> t[T] {
fn get[T](vec[cell[T]] elts, uint i) -> T {
alt (elts.(i)) {
case (option.some[T](?t)) { ret t; }
case (_) { fail; }
}
fail; // FIXME: remove me when exhaustiveness checking works
}

View file

@ -176,6 +176,7 @@ fn mk_hashmap[K, V](&hashfn[K] hasher, &eqfn[K] eqer) -> hashmap[K, V] {
fn get(&K key) -> V {
alt (find_common[K, V](hasher, eqer, bkts, nbkts, key)) {
case (option.some[V](?val)) { ret val; }
case (_) { fail; }
}
fail; // FIXME: remove me when exhaustiveness checking works
}