@@ -423,7 +423,6 @@ fn mk_mach(&ctxt cx, &util::common::ty_mach tm) -> t {
423
423
case ( ty_f32) { ret idx_f32; }
424
424
case ( ty_f64) { ret idx_f64; }
425
425
}
426
- fail;
427
426
}
428
427
429
428
fn mk_char ( & ctxt cx) -> t { ret idx_char; }
@@ -895,7 +894,6 @@ fn type_is_structural(&ctxt cx, &t ty) -> bool {
895
894
case ( ty_obj( _) ) { ret true; }
896
895
case ( _) { ret false; }
897
896
}
898
- fail;
899
897
}
900
898
901
899
fn type_is_sequence( & ctxt cx, & t ty) -> bool {
@@ -904,14 +902,17 @@ fn type_is_sequence(&ctxt cx, &t ty) -> bool {
904
902
case ( ty_vec( _) ) { ret true; }
905
903
case ( _) { ret false; }
906
904
}
907
- fail;
908
905
}
909
906
910
907
fn sequence_element_type( & ctxt cx, & t ty) -> t {
911
908
alt ( struct ( cx, ty) ) {
912
909
case ( ty_str) { ret mk_mach( cx, common:: ty_u8) ; }
913
910
case ( ty_vec( ?mt) ) { ret mt. ty; }
911
+ // NB: This is not exhaustive.
914
912
}
913
+
914
+ // FIXME: add sess.err or sess.span_err explaining failure (issue
915
+ // #444)
915
916
fail;
916
917
}
917
918
@@ -923,7 +924,6 @@ fn type_is_tup_like(&ctxt cx, &t ty) -> bool {
923
924
case ( ty_tag( _, _) ) { ret true; }
924
925
case ( _) { ret false; }
925
926
}
926
- fail;
927
927
}
928
928
929
929
fn get_element_type( & ctxt cx, & t ty, uint i) -> t {
@@ -935,7 +935,11 @@ fn get_element_type(&ctxt cx, &t ty, uint i) -> t {
935
935
case ( ty_rec( ?flds) ) {
936
936
ret flds. ( i) . mt. ty;
937
937
}
938
+ // NB: This is not exhaustive -- struct(cx, ty) could be a box or a
939
+ // tag.
938
940
}
941
+
942
+ // FIXME: add sess.err or sess.span_err explaining failure (issue #444)
939
943
fail;
940
944
}
941
945
@@ -944,7 +948,6 @@ fn type_is_box(&ctxt cx, &t ty) -> bool {
944
948
case ( ty_box( _) ) { ret true; }
945
949
case ( _) { ret false; }
946
950
}
947
- fail;
948
951
}
949
952
950
953
fn type_is_boxed( & ctxt cx, & t ty) -> bool {
@@ -957,7 +960,6 @@ fn type_is_boxed(&ctxt cx, &t ty) -> bool {
957
960
case ( ty_task) { ret true; }
958
961
case ( _) { ret false; }
959
962
}
960
- fail;
961
963
}
962
964
963
965
fn type_is_scalar( & ctxt cx, & t ty) -> bool {
@@ -973,10 +975,8 @@ fn type_is_scalar(&ctxt cx, &t ty) -> bool {
973
975
case ( ty_native) { ret true; }
974
976
case ( _) { ret false; }
975
977
}
976
- fail;
977
978
}
978
979
979
-
980
980
fn type_has_pointers( & ctxt cx, & t ty) -> bool {
981
981
alt ( struct ( cx, ty) ) {
982
982
// scalar types
@@ -1017,7 +1017,6 @@ fn type_has_pointers(&ctxt cx, &t ty) -> bool {
1017
1017
}
1018
1018
case ( _) { ret true; }
1019
1019
}
1020
- fail;
1021
1020
}
1022
1021
1023
1022
@@ -1028,7 +1027,6 @@ fn type_is_native(&ctxt cx, &t ty) -> bool {
1028
1027
case ( ty_native) { ret true; }
1029
1028
case ( _) { ret false; }
1030
1029
}
1031
- fail;
1032
1030
}
1033
1031
1034
1032
fn type_has_dynamic_size( & ctxt cx, & t ty) -> bool {
@@ -1083,7 +1081,6 @@ fn type_is_integral(&ctxt cx, &t ty) -> bool {
1083
1081
case ( ty_char) { ret true; }
1084
1082
case ( _) { ret false; }
1085
1083
}
1086
- fail;
1087
1084
}
1088
1085
1089
1086
fn type_is_fp( & ctxt cx, & t ty) -> bool {
@@ -1100,7 +1097,6 @@ fn type_is_fp(&ctxt cx, &t ty) -> bool {
1100
1097
}
1101
1098
case ( _) { ret false; }
1102
1099
}
1103
- fail;
1104
1100
}
1105
1101
1106
1102
fn type_is_signed( & ctxt cx, & t ty) -> bool {
@@ -1117,7 +1113,6 @@ fn type_is_signed(&ctxt cx, &t ty) -> bool {
1117
1113
}
1118
1114
case ( _) { ret false; }
1119
1115
}
1120
- fail;
1121
1116
}
1122
1117
1123
1118
fn type_param( & ctxt cx, & t ty) -> option:: t[ uint] {
@@ -1656,7 +1651,6 @@ fn is_fn_ty(&ctxt cx, &t fty) -> bool {
1656
1651
case ( ty:: ty_native_fn ( _, _, _) ) { ret true ; }
1657
1652
case ( _) { ret false ; }
1658
1653
}
1659
- ret false;
1660
1654
}
1661
1655
1662
1656
@@ -2642,9 +2636,6 @@ mod unify {
2642
2636
ret cx. handler . record_param ( expected_id, actual) ;
2643
2637
}
2644
2638
}
2645
-
2646
- // TODO: remove me once match-exhaustiveness checking works
2647
- fail;
2648
2639
}
2649
2640
2650
2641
// Performs type binding substitution.
0 commit comments