mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +00:00
Remove usages of case(_) { fail; } since the compiler does this automatically
This commit is contained in:
parent
530fe1daea
commit
92a716d862
|
@ -1789,7 +1789,6 @@ fn variant_types(@crate_ctxt cx, &ast.variant v) -> vec[@ty.t] {
|
|||
}
|
||||
}
|
||||
case (ty.ty_tag(_, _)) { /* nothing */ }
|
||||
case (_) { fail; }
|
||||
}
|
||||
ret tys;
|
||||
}
|
||||
|
@ -2002,7 +2001,6 @@ fn iter_boxpp(@block_ctxt cx,
|
|||
j += 1;
|
||||
}
|
||||
}
|
||||
case (_) { fail; }
|
||||
}
|
||||
|
||||
variant_cx.build.Br(next_cx.llbb);
|
||||
|
@ -2169,7 +2167,6 @@ fn iter_sequence_body(@block_ctxt cx,
|
|||
auto et = plain_ty(ty.ty_machine(common.ty_u8));
|
||||
ret iter_sequence_body(cx, v, et, f, true);
|
||||
}
|
||||
case (_) { fail; }
|
||||
}
|
||||
cx.fcx.ccx.sess.bug("bad type in trans.iter_sequence");
|
||||
fail;
|
||||
|
|
|
@ -1861,9 +1861,6 @@ fn check_assignment(&@fn_ctxt fcx, @ast.expr lhs, @ast.expr rhs)
|
|||
case (ty.ty_chan(?it)) {
|
||||
item_t = it;
|
||||
}
|
||||
case (_) {
|
||||
fail;
|
||||
}
|
||||
}
|
||||
auto rhs_1 = demand_expr(fcx, item_t, rhs_0);
|
||||
|
||||
|
@ -1884,9 +1881,6 @@ fn check_assignment(&@fn_ctxt fcx, @ast.expr lhs, @ast.expr rhs)
|
|||
case (ty.ty_port(?it)) {
|
||||
item_t = it;
|
||||
}
|
||||
case (_) {
|
||||
fail;
|
||||
}
|
||||
}
|
||||
auto lhs_1 = demand_expr(fcx, item_t, lhs_0);
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ fn fill[T](uint i, uint nelts, uint lo,
|
|||
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
|
||||
}
|
||||
|
|
|
@ -176,7 +176,6 @@ fn contains_key(&K key) -> bool {
|
|||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue