about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorLindsey Kuper <lkuper@mozilla.com>2011-06-02 18:10:18 -0700
committerLindsey Kuper <lkuper@mozilla.com>2011-06-02 18:15:29 -0700
commitdc29dead2e00510577c12a45137ccf82a5863572 (patch)
tree243792b4d6f5c2cf0695f80c999c9dee3d80196c /src/comp
parentad9afefa1014e01e63bf1cb48c4f1f9d98a98201 (diff)
Removing redundant "fail"s.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/ty.rs25
-rw-r--r--src/comp/middle/typeck.rs2
2 files changed, 8 insertions, 19 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index 5f0c9a90362..e7c5001f824 100644
--- a/src/comp/middle/ty.rs
+++ b/src/comp/middle/ty.rs
@@ -423,7 +423,6 @@ fn mk_mach(&ctxt cx, &util::common::ty_mach tm) -> t {
         case (ty_f32) { ret idx_f32; }
         case (ty_f64) { ret idx_f64; }
     }
-    fail;
 }
 
 fn mk_char(&ctxt cx) -> t    { ret idx_char; }
@@ -895,7 +894,6 @@ fn type_is_structural(&ctxt cx, &t ty) -> bool {
         case (ty_obj(_))    { ret true; }
         case (_)            { ret false; }
     }
-    fail;
 }
 
 fn type_is_sequence(&ctxt cx, &t ty) -> bool {
@@ -904,14 +902,17 @@ fn type_is_sequence(&ctxt cx, &t ty) -> bool {
         case (ty_vec(_))    { ret true; }
         case (_)            { ret false; }
     }
-    fail;
 }
 
 fn sequence_element_type(&ctxt cx, &t ty) -> t {
     alt (struct(cx, ty)) {
         case (ty_str)      { ret mk_mach(cx, common::ty_u8); }
         case (ty_vec(?mt)) { ret mt.ty; }
+        // NB: This is not exhaustive.
     }
+
+    // FIXME: add sess.err or sess.span_err explaining failure (issue
+    // #444)
     fail;
 }
 
@@ -923,7 +924,6 @@ fn type_is_tup_like(&ctxt cx, &t ty) -> bool {
         case (ty_tag(_,_))  { ret true; }
         case (_)            { ret false; }
     }
-    fail;
 }
 
 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 {
         case (ty_rec(?flds)) {
             ret flds.(i).mt.ty;
         }
+        // NB: This is not exhaustive -- struct(cx, ty) could be a box or a
+        // tag.
     }
+
+    // FIXME: add sess.err or sess.span_err explaining failure (issue #444)
     fail;
 }
 
@@ -944,7 +948,6 @@ fn type_is_box(&ctxt cx, &t ty) -> bool {
         case (ty_box(_)) { ret true; }
         case (_) { ret false; }
     }
-    fail;
 }
 
 fn type_is_boxed(&ctxt cx, &t ty) -> bool {
@@ -957,7 +960,6 @@ fn type_is_boxed(&ctxt cx, &t ty) -> bool {
         case (ty_task) { ret true; }
         case (_) { ret false; }
     }
-    fail;
 }
 
 fn type_is_scalar(&ctxt cx, &t ty) -> bool {
@@ -973,10 +975,8 @@ fn type_is_scalar(&ctxt cx, &t ty) -> bool {
         case (ty_native) { ret true; }
         case (_) { ret false; }
     }
-    fail;
 }
 
-
 fn type_has_pointers(&ctxt cx, &t ty) -> bool {
     alt (struct(cx, ty)) {
         // scalar types
@@ -1017,7 +1017,6 @@ fn type_has_pointers(&ctxt cx, &t ty) -> bool {
         }
         case (_) { ret true; }
     }
-    fail;
 }
 
 
@@ -1028,7 +1027,6 @@ fn type_is_native(&ctxt cx, &t ty) -> bool {
         case (ty_native) { ret true; }
         case (_) { ret false; }
     }
-    fail;
 }
 
 fn type_has_dynamic_size(&ctxt cx, &t ty) -> bool {
@@ -1083,7 +1081,6 @@ fn type_is_integral(&ctxt cx, &t ty) -> bool {
         case (ty_char) { ret true; }
         case (_) { ret false; }
     }
-    fail;
 }
 
 fn type_is_fp(&ctxt cx, &t ty) -> bool {
@@ -1100,7 +1097,6 @@ fn type_is_fp(&ctxt cx, &t ty) -> bool {
         }
         case (_) { ret false; }
     }
-    fail;
 }
 
 fn type_is_signed(&ctxt cx, &t ty) -> bool {
@@ -1117,7 +1113,6 @@ fn type_is_signed(&ctxt cx, &t ty) -> bool {
         }
         case (_) { ret false; }
     }
-    fail;
 }
 
 fn type_param(&ctxt cx, &t ty) -> option::t[uint] {
@@ -1656,7 +1651,6 @@ fn is_fn_ty(&ctxt cx, &t fty) -> bool {
         case (ty::ty_native_fn(_, _, _)) { ret true; }
         case (_) { ret false; }
     }
-    ret false;
 }
 
 
@@ -2642,9 +2636,6 @@ mod unify {
                 ret cx.handler.record_param(expected_id, actual);
             }
         }
-
-        // TODO: remove me once match-exhaustiveness checking works
-        fail;
     }
 
     // Performs type binding substitution.
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs
index 8d8f0151df2..551184b037d 100644
--- a/src/comp/middle/typeck.rs
+++ b/src/comp/middle/typeck.rs
@@ -1578,8 +1578,6 @@ fn check_lit(@crate_ctxt ccx, &@ast::lit lit) -> ty::t {
         case (ast::lit_nil)                 { ret ty::mk_nil(ccx.tcx);  }
         case (ast::lit_bool(_))             { ret ty::mk_bool(ccx.tcx); }
     }
-
-    fail; // not reached
 }
 
 // Pattern checking is top-down rather than bottom-up so that bindings get