@@ -822,16 +822,15 @@ fn trans_alt(bcx: block,
822
822
alt_expr : @ast:: expr ,
823
823
expr : @ast:: expr ,
824
824
arms : ~[ ast:: arm ] ,
825
- mode : ast:: alt_mode ,
826
825
dest : dest ) -> block {
827
826
let _icx = bcx. insn_ctxt ( "alt::trans_alt" ) ;
828
827
do with_scope( bcx, alt_expr. info ( ) , ~"alt") |bcx| {
829
- trans_alt_inner ( bcx, expr, arms, mode , dest)
828
+ trans_alt_inner ( bcx, expr, arms, dest)
830
829
}
831
830
}
832
831
833
832
fn trans_alt_inner ( scope_cx : block , expr : @ast:: expr , arms : ~[ ast:: arm ] ,
834
- mode : ast :: alt_mode , dest : dest ) -> block {
833
+ dest : dest ) -> block {
835
834
let _icx = scope_cx. insn_ctxt ( "alt::trans_alt_inner" ) ;
836
835
let bcx = scope_cx, tcx = bcx. tcx ( ) ;
837
836
let mut bodies = ~[ ] , matches = ~[ ] ;
@@ -860,15 +859,7 @@ fn trans_alt_inner(scope_cx: block, expr: @ast::expr, arms: ~[ast::arm],
860
859
return fail_cx. llbb ;
861
860
}
862
861
let t = node_id_type ( bcx, expr. id ) ;
863
- let mk_fail = match mode {
864
- ast:: alt_check => {
865
- let fail_cx = @mut none;
866
- // Cached fail-on-fallthrough block
867
- some ( || mk_fail ( scope_cx, expr. span , ~"non-exhaustive match failure",
868
- fail_cx) )
869
- }
870
- ast:: alt_exhaustive => {
871
- let fail_cx = @mut none;
862
+ let mk_fail = { let fail_cx = @mut none;
872
863
// special case for uninhabited type
873
864
if ty:: type_is_empty ( tcx, t) {
874
865
some ( || mk_fail ( scope_cx, expr. span ,
@@ -877,7 +868,6 @@ fn trans_alt_inner(scope_cx: block, expr: @ast::expr, arms: ~[ast::arm],
877
868
else {
878
869
none
879
870
}
880
- }
881
871
} ;
882
872
let mut exit_map = ~[ ] ;
883
873
let spilled = spill_if_immediate ( bcx, val, t) ;
0 commit comments