about summary refs log tree commit diff
path: root/src/comp/syntax/ext
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-01-30 21:00:57 -0800
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-01-31 10:08:24 -0800
commitfba35e1a3c87892823d1f4d436b9f00a7864cf16 (patch)
tree1fadaaee99ef266bd2f709fb2aa5577184ab611e /src/comp/syntax/ext
parent813a55d89135efb716dd80e96453a091a7cfc631 (diff)
downloadrust-fba35e1a3c87892823d1f4d436b9f00a7864cf16.tar.gz
rust-fba35e1a3c87892823d1f4d436b9f00a7864cf16.zip
Require alts to be exhaustive
middle::check_alt does the work. Lots of changes to add default cases
into alts that were previously inexhaustive.
Diffstat (limited to 'src/comp/syntax/ext')
-rw-r--r--src/comp/syntax/ext/simplext.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/comp/syntax/ext/simplext.rs b/src/comp/syntax/ext/simplext.rs
index 5477c495883..b7fdfc46908 100644
--- a/src/comp/syntax/ext/simplext.rs
+++ b/src/comp/syntax/ext/simplext.rs
@@ -4,6 +4,7 @@ import codemap::span;
 import core::{vec, option};
 import std::map::{hashmap, new_str_hash};
 import option::{some, none};
+import driver::session::session;
 
 import base::{ext_ctxt, normal};
 
@@ -460,11 +461,6 @@ fn p_t_s_rec(cx: ext_ctxt, m: matchable, s: selector, b: binders) {
               }
             }
           }
-
-
-
-
-
           /* TODO: handle embedded types and blocks, at least */
           expr_mac(mac) {
             p_t_s_r_mac(cx, mac, s, b);
@@ -483,6 +479,9 @@ fn p_t_s_rec(cx: ext_ctxt, m: matchable, s: selector, b: binders) {
           }
         }
       }
+      _ {
+          cx.session().bug("undocumented invariant in p_t_s_rec");
+      }
     }
 }
 
@@ -718,6 +717,10 @@ fn add_new_extension(cx: ext_ctxt, sp: span, arg: @expr,
                     // FIXME: check duplicates (or just simplify
                     // the macro arg situation)
                   }
+                  _ {
+                      cx.span_bug(mac.span, "undocumented invariant in \
+                         add_extension");
+                  }
                 }
               }
               _ {