about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs78
-rw-r--r--src/libsyntax/ast_util.rs16
-rw-r--r--src/libsyntax/ext/auto_serialize.rs17
-rw-r--r--src/libsyntax/ext/pipes/ast_builder.rs5
-rw-r--r--src/libsyntax/fold.rs44
-rw-r--r--src/libsyntax/parse/classify.rs9
-rw-r--r--src/libsyntax/parse/parser.rs153
-rw-r--r--src/libsyntax/parse/token.rs2
-rw-r--r--src/libsyntax/print/pprust.rs87
-rw-r--r--src/libsyntax/visit.rs41
10 files changed, 29 insertions, 423 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 6cf6818ba40..db70ad12b6e 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -285,9 +285,6 @@ type field = spanned<field_>;
 enum blk_check_mode { default_blk, unchecked_blk, unsafe_blk, }
 
 #[auto_serialize]
-enum expr_check_mode { claimed_expr, checked_expr, }
-
-#[auto_serialize]
 type expr = {id: node_id, callee_id: node_id, node: expr_, span: span};
 // Extra node ID is only used for index, assign_op, unary, binary
 
@@ -322,10 +319,6 @@ enum expr_ {
     expr_do_body(@expr),
     expr_block(blk),
 
-    /*
-     * FIXME (#34): many of these @exprs should be constrained with
-     * is_lval once we have constrained types working.
-     */
     expr_copy(@expr),
     expr_move(@expr, @expr),
     expr_assign(@expr, @expr),
@@ -348,9 +341,6 @@ enum expr_ {
     /* just an assert, no significance to typestate */
     expr_assert(@expr),
 
-    /* preds that typestate is aware of */
-    expr_check(expr_check_mode, @expr),
-    expr_if_check(@expr, blk, option<@expr>),
     expr_mac(mac),
 }
 
@@ -365,15 +355,6 @@ type capture_item = @{
 #[auto_serialize]
 type capture_clause = @~[capture_item];
 
-/*
-// Says whether this is a block the user marked as
-// "unchecked"
-enum blk_sort {
-    blk_unchecked, // declared as "exception to effect-checking rules"
-    blk_checked, // all typing rules apply
-}
-*/
-
 #[auto_serialize]
 #[doc="For macro invocations; parsing is delegated to the macro"]
 enum token_tree {
@@ -384,8 +365,6 @@ enum token_tree {
     tt_interpolate(span, ident)
 }
 
-
-
 #[auto_serialize]
 type matcher = spanned<matcher_>;
 
@@ -502,7 +481,6 @@ enum ty_ {
     ty_fn(proto, fn_decl),
     ty_tup(~[@ty]),
     ty_path(@path, node_id),
-    ty_constr(@ty, ~[@ty_constr]),
     ty_fixed_length(@ty, option<uint>),
     ty_mac(mac),
     // ty_infer means the type should be inferred instead of it having been
@@ -511,59 +489,6 @@ enum ty_ {
     ty_infer,
 }
 
-
-/*
-A constraint arg that's a function argument is referred to by its position
-rather than name.  This is so we could have higher-order functions that have
-constraints (potentially -- right now there's no way to write that), and also
-so that the typestate pass doesn't have to map a function name onto its decl.
-So, the constr_arg type is parameterized: it's instantiated with uint for
-declarations, and ident for uses.
-*/
-#[auto_serialize]
-enum constr_arg_general_<T> { carg_base, carg_ident(T), carg_lit(@lit), }
-
-#[auto_serialize]
-type fn_constr_arg = constr_arg_general_<uint>;
-
-#[auto_serialize]
-type sp_constr_arg<T> = spanned<constr_arg_general_<T>>;
-
-#[auto_serialize]
-type ty_constr_arg = sp_constr_arg<@path>;
-
-#[auto_serialize]
-type constr_arg = spanned<fn_constr_arg>;
-
-// Constrained types' args are parameterized by paths, since
-// we refer to paths directly and not by indices.
-// The implicit root of such path, in the constraint-list for a
-// constrained type, is * (referring to the base record)
-
-#[auto_serialize]
-type constr_general_<ARG, ID> =
-    {path: @path, args: ~[@sp_constr_arg<ARG>], id: ID};
-
-// In the front end, constraints have a node ID attached.
-// Typeck turns this to a def_id, using the output of resolve.
-#[auto_serialize]
-type constr_general<ARG> = spanned<constr_general_<ARG, node_id>>;
-
-#[auto_serialize]
-type constr_ = constr_general_<uint, node_id>;
-
-#[auto_serialize]
-type constr = spanned<constr_general_<uint, node_id>>;
-
-#[auto_serialize]
-type ty_constr_ = constr_general_<@path, node_id>;
-
-#[auto_serialize]
-type ty_constr = spanned<ty_constr_>;
-
-/* The parser generates ast::constrs; resolve generates
- a mapping from each function to a list of ty::constr_defs,
- corresponding to these. */
 #[auto_serialize]
 type arg = {mode: mode, ty: @ty, ident: ident, id: node_id};
 
@@ -572,8 +497,7 @@ type fn_decl =
     {inputs: ~[arg],
      output: @ty,
      purity: purity,
-     cf: ret_style,
-     constraints: ~[@constr]};
+     cf: ret_style};
 
 #[auto_serialize]
 enum purity {
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index 556239769da..49478779fba 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -213,14 +213,6 @@ pure fn is_call_expr(e: @expr) -> bool {
     alt e.node { expr_call(_, _, _) { true } _ { false } }
 }
 
-fn is_constraint_arg(e: @expr) -> bool {
-    alt e.node {
-      expr_lit(_) { ret true; }
-      expr_path(_) { ret true; }
-      _ { ret false; }
-    }
-}
-
 fn eq_ty(&&a: @ty, &&b: @ty) -> bool { ret box::ptr_eq(a, b); }
 
 fn hash_ty(&&t: @ty) -> uint {
@@ -381,8 +373,8 @@ fn dtor_dec() -> fn_decl {
     let nil_t = @{id: 0, node: ty_nil, span: dummy_sp()};
     // dtor has one argument, of type ()
     {inputs: ~[{mode: ast::expl(ast::by_ref),
-               ty: nil_t, ident: @~"_", id: 0}],
-     output: nil_t, purity: impure_fn, cf: return_val, constraints: ~[]}
+                ty: nil_t, ident: @~"_", id: 0}],
+     output: nil_t, purity: impure_fn, cf: return_val}
 }
 
 // ______________________________________________________________________
@@ -467,10 +459,6 @@ fn id_visitor(vfn: fn@(node_id)) -> visit::vt<()> {
             vec::iter(ps, |p| vfn(p.id))
         },
 
-        visit_constr: fn@(_p: @path, _sp: span, id: node_id) {
-            vfn(id);
-        },
-
         visit_fn: fn@(fk: visit::fn_kind, d: ast::fn_decl,
                       _b: ast::blk, _sp: span, id: ast::node_id) {
             vfn(id);
diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs
index 98671234249..a7a6080fb0b 100644
--- a/src/libsyntax/ext/auto_serialize.rs
+++ b/src/libsyntax/ext/auto_serialize.rs
@@ -162,8 +162,7 @@ impl helpers for ext_ctxt {
           node: ast::ty_fn(ast::proto_any, {inputs: args,
                                             output: output,
                                             purity: ast::impure_fn,
-                                            cf: ast::return_val,
-                                            constraints: ~[]}),
+                                            cf: ast::return_val}),
           span: span}
     }
 
@@ -466,10 +465,6 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
         }
       }
 
-      ast::ty_constr(ty, _) {
-        ser_ty(cx, tps, ty, s, v)
-      }
-
       ast::ty_mac(_) {
         cx.span_err(ty.span, ~"cannot serialize macro types");
         ~[]
@@ -573,8 +568,7 @@ fn mk_ser_fn(cx: ext_ctxt, span: span, name: ast::ident,
       node: ast::item_fn({inputs: ser_inputs,
                           output: ser_output,
                           purity: ast::impure_fn,
-                          cf: ast::return_val,
-                          constraints: ~[]},
+                          cf: ast::return_val},
                          ser_tps,
                          ser_blk),
       vis: ast::public,
@@ -697,10 +691,6 @@ fn deser_ty(cx: ext_ctxt, tps: deser_tps_map,
         }
       }
 
-      ast::ty_constr(ty, constrs) {
-        deser_ty(cx, tps, ty, d)
-      }
-
       ast::ty_mac(_) {
         #ast{ fail }
       }
@@ -783,8 +773,7 @@ fn mk_deser_fn(cx: ext_ctxt, span: span,
       node: ast::item_fn({inputs: deser_inputs,
                           output: v_ty,
                           purity: ast::impure_fn,
-                          cf: ast::return_val,
-                          constraints: ~[]},
+                          cf: ast::return_val},
                          deser_tps,
                          deser_blk),
       vis: ast::public,
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs
index cb0abe9e8e5..2a2fbe2628a 100644
--- a/src/libsyntax/ext/pipes/ast_builder.rs
+++ b/src/libsyntax/ext/pipes/ast_builder.rs
@@ -89,10 +89,7 @@ impl ast_builder for ext_ctxt {
         {inputs: inputs,
          output: output,
          purity: ast::impure_fn,
-         cf: ast::return_val,
-         // FIXME #2886: we'll probably want a variant that does constrained
-         // types.
-         constraints: ~[]}
+         cf: ast::return_val}
     }
 
     fn item(name: ident,
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs
index e3bb29cdb92..965caacf07a 100644
--- a/src/libsyntax/fold.rs
+++ b/src/libsyntax/fold.rs
@@ -33,8 +33,6 @@ iface ast_fold {
     fn fold_decl(&&@decl) -> @decl;
     fn fold_expr(&&@expr) -> @expr;
     fn fold_ty(&&@ty) -> @ty;
-    fn fold_constr(&&@constr) -> @constr;
-    fn fold_ty_constr(&&@ty_constr) -> @ty_constr;
     fn fold_mod(_mod) -> _mod;
     fn fold_foreign_mod(foreign_mod) -> foreign_mod;
     fn fold_variant(variant) -> variant;
@@ -66,9 +64,6 @@ type ast_fold_precursor = @{
     fold_decl: fn@(decl_, span, ast_fold) -> (decl_, span),
     fold_expr: fn@(expr_, span, ast_fold) -> (expr_, span),
     fold_ty: fn@(ty_, span, ast_fold) -> (ty_, span),
-    fold_constr: fn@(ast::constr_, span, ast_fold) -> (constr_, span),
-    fold_ty_constr: fn@(ast::ty_constr_, span, ast_fold)
-        -> (ty_constr_, span),
     fold_mod: fn@(_mod, ast_fold) -> _mod,
     fold_foreign_mod: fn@(foreign_mod, ast_fold) -> foreign_mod,
     fold_variant: fn@(variant_, span, ast_fold) -> (variant_, span),
@@ -135,8 +130,7 @@ fn fold_fn_decl(decl: ast::fn_decl, fld: ast_fold) -> ast::fn_decl {
     ret {inputs: vec::map(decl.inputs, |x| fold_arg_(x, fld) ),
          output: fld.fold_ty(decl.output),
          purity: decl.purity,
-         cf: decl.cf,
-         constraints: vec::map(decl.constraints, |x| fld.fold_constr(x))}
+         cf: decl.cf}
 }
 
 fn fold_ty_param_bound(tpb: ty_param_bound, fld: ast_fold) -> ty_param_bound {
@@ -200,10 +194,7 @@ fn noop_fold_foreign_item(&&ni: @foreign_item, fld: ast_fold)
                   foreign_item_fn({inputs: vec::map(fdec.inputs, fold_arg),
                                   output: fld.fold_ty(fdec.output),
                                   purity: fdec.purity,
-                                  cf: fdec.cf,
-                                  constraints:
-                                      vec::map(fdec.constraints,
-                                               |x| fld.fold_constr(x))},
+                                  cf: fdec.cf},
                                  fold_ty_params(typms, fld))
                 }
               },
@@ -474,11 +465,6 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ {
           expr_log(i, lv, e) { expr_log(i, fld.fold_expr(lv),
                                         fld.fold_expr(e)) }
           expr_assert(e) { expr_assert(fld.fold_expr(e)) }
-          expr_check(m, e) { expr_check(m, fld.fold_expr(e)) }
-          expr_if_check(cond, tr, fl) {
-            expr_if_check(fld.fold_expr(cond), fld.fold_block(tr),
-                          option::map(fl, |x| fld.fold_expr(x)))
-          }
           expr_mac(mac) { expr_mac(fold_mac(mac)) }
         }
 }
@@ -504,24 +490,11 @@ fn noop_fold_ty(t: ty_, fld: ast_fold) -> ty_ {
       ty_fn(proto, decl) {ty_fn(proto, fold_fn_decl(decl, fld))}
       ty_tup(tys) {ty_tup(vec::map(tys, |ty| fld.fold_ty(ty)))}
       ty_path(path, id) {ty_path(fld.fold_path(path), fld.new_id(id))}
-      ty_constr(ty, constrs) {ty_constr(fld.fold_ty(ty),
-                                vec::map(constrs, |x| fld.fold_ty_constr(x)))}
       ty_fixed_length(t, vs) {ty_fixed_length(fld.fold_ty(t), vs)}
       ty_mac(mac) {ty_mac(fold_mac(mac))}
     }
 }
 
-fn noop_fold_constr(c: constr_, fld: ast_fold) -> constr_ {
-    {path: fld.fold_path(c.path), args: /* FIXME (#2543) */ copy c.args,
-     id: fld.new_id(c.id)}
-}
-
-fn noop_fold_ty_constr(c: ty_constr_, fld: ast_fold) -> ty_constr_ {
-    let rslt: ty_constr_ =
-        {path: fld.fold_path(c.path), args: /* FIXME (#2543) */ copy c.args,
-         id: fld.new_id(c.id)};
-    rslt
-}
 // ...nor do modules
 fn noop_fold_mod(m: _mod, fld: ast_fold) -> _mod {
     ret {view_items: vec::map(m.view_items, |x| fld.fold_view_item(x)),
@@ -606,8 +579,6 @@ fn default_ast_fold() -> ast_fold_precursor {
           fold_decl: wrap(noop_fold_decl),
           fold_expr: wrap(noop_fold_expr),
           fold_ty: wrap(noop_fold_ty),
-          fold_constr: wrap(noop_fold_constr),
-          fold_ty_constr: wrap(noop_fold_ty_constr),
           fold_mod: noop_fold_mod,
           fold_foreign_mod: noop_fold_foreign_mod,
           fold_variant: wrap(noop_fold_variant),
@@ -697,17 +668,6 @@ impl of ast_fold for ast_fold_precursor {
         let (n, s) = self.fold_ty(x.node, x.span, self as ast_fold);
         ret @{id: self.new_id(x.id), node: n, span: self.new_span(s)};
     }
-    fn fold_constr(&&x: @ast::constr) ->
-       @ast::constr {
-        let (n, s) = self.fold_constr(x.node, x.span, self as ast_fold);
-        ret @{node: n, span: self.new_span(s)};
-    }
-    fn fold_ty_constr(&&x: @ast::ty_constr) ->
-       @ast::ty_constr {
-        let (n, s) : (ty_constr_, span) =
-            self.fold_ty_constr(x.node, x.span, self as ast_fold);
-        ret @{node: n, span: self.new_span(s)};
-    }
     fn fold_mod(x: _mod) -> _mod {
         ret self.fold_mod(x, self as ast_fold);
     }
diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/parse/classify.rs
index 9b36b77407e..20fb7772d08 100644
--- a/src/libsyntax/parse/classify.rs
+++ b/src/libsyntax/parse/classify.rs
@@ -6,8 +6,7 @@ import ast_util::operator_prec;
 
 fn expr_requires_semi_to_be_stmt(e: @ast::expr) -> bool {
     alt e.node {
-      ast::expr_if(_, _, _) | ast::expr_if_check(_, _, _)
-      | ast::expr_alt(_, _, _) | ast::expr_block(_)
+      ast::expr_if(_, _, _) | ast::expr_alt(_, _, _) | ast::expr_block(_)
       | ast::expr_while(_, _) | ast::expr_loop(_)
       | ast::expr_call(_, _, true) {
         false
@@ -44,7 +43,6 @@ fn need_parens(expr: @ast::expr, outer_prec: uint) -> bool {
       ast::expr_assign_op(_, _, _) { true }
       ast::expr_ret(_) { true }
       ast::expr_assert(_) { true }
-      ast::expr_check(_, _) { true }
       ast::expr_log(_, _, _) { true }
       _ { !parse::classify::expr_requires_semi_to_be_stmt(expr) }
     }
@@ -64,8 +62,9 @@ fn ends_in_lit_int(ex: @ast::expr) -> bool {
       ast::expr_move(_, sub) | ast::expr_copy(sub) |
       ast::expr_assign(_, sub) |
       ast::expr_assign_op(_, _, sub) | ast::expr_swap(_, sub) |
-      ast::expr_log(_, _, sub) | ast::expr_assert(sub) |
-      ast::expr_check(_, sub) { ends_in_lit_int(sub) }
+      ast::expr_log(_, _, sub) | ast::expr_assert(sub) {
+        ends_in_lit_int(sub)
+      }
       ast::expr_fail(osub) | ast::expr_ret(osub) {
         alt osub {
           some(ex) { ends_in_lit_int(ex) }
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index b67fd88ab61..fa0361e797b 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -20,14 +20,14 @@ import ast::{_mod, add, alt_check, alt_exhaustive, arg, arm, attribute,
              by_mutbl_ref, by_ref, by_val, capture_clause, capture_item,
              carg_base, carg_ident, cdir_dir_mod, cdir_src_mod,
              cdir_view_item, checked_expr, claimed_expr, class_immutable,
-             class_member, class_method, class_mutable, constr, constr_arg,
-             constr_general, crate, crate_cfg, crate_directive, decl,
+             class_member, class_method, class_mutable,
+             crate, crate_cfg, crate_directive, decl,
              decl_item, decl_local, default_blk, deref, div, expl, expr,
              expr_, expr_addr_of, expr_alt, expr_again, expr_assert,
              expr_assign, expr_assign_op, expr_binary, expr_block, expr_break,
-             expr_call, expr_cast, expr_check, expr_copy, expr_do_body,
+             expr_call, expr_cast, expr_copy, expr_do_body,
              expr_fail, expr_field, expr_fn, expr_fn_block, expr_if,
-             expr_if_check, expr_index, expr_lit, expr_log, expr_loop,
+             expr_index, expr_lit, expr_log, expr_loop,
              expr_loop_body, expr_mac, expr_move, expr_new, expr_path,
              expr_rec, expr_ret, expr_swap, expr_tup, expr_unary, expr_vec,
              expr_vstore, expr_while, extern_fn, field, fn_decl, foreign_item,
@@ -265,15 +265,9 @@ class parser {
             {mode: mode, ty: p.parse_ty(false), ident: name,
              id: p.get_id()}
         };
-        // FIXME (#34): constrs is empty because right now, higher-order
-        // functions can't have constrained types. Not sure whether
-        // that would be desirable anyway. See bug for the story on
-        // constrained types.
-        let constrs: ~[@constr] = ~[];
         let (ret_style, ret_ty) = self.parse_ret_ty();
         ret {inputs: inputs, output: ret_ty,
-             purity: purity, cf: ret_style,
-             constraints: constrs};
+             purity: purity, cf: ret_style};
     }
 
     fn parse_trait_methods() -> ~[trait_method] {
@@ -341,79 +335,6 @@ class parser {
         ret spanned(lo, ty.span.hi, {ident: id, mt: {ty: ty, mutbl: mutbl}});
     }
 
-    // if i is the jth ident in args, return j
-    // otherwise, fail
-    fn ident_index(args: ~[arg], i: ident) -> uint {
-        let mut j = 0u;
-        for args.each |a| { if a.ident == i { ret j; } j += 1u; }
-        self.fatal(~"unbound variable `" + *i + ~"` in constraint arg");
-    }
-
-    fn parse_type_constr_arg() -> @ty_constr_arg {
-        let sp = self.span;
-        let mut carg = carg_base;
-        self.expect(token::BINOP(token::STAR));
-        if self.token == token::DOT {
-            // "*..." notation for record fields
-            self.bump();
-            let pth = self.parse_path_without_tps();
-            carg = carg_ident(pth);
-        }
-        // No literals yet, I guess?
-        ret @{node: carg, span: sp};
-    }
-
-    fn parse_constr_arg(args: ~[arg]) -> @constr_arg {
-        let sp = self.span;
-        let mut carg = carg_base;
-        if self.token == token::BINOP(token::STAR) {
-            self.bump();
-        } else {
-            let i: ident = self.parse_value_ident();
-            carg = carg_ident(self.ident_index(args, i));
-        }
-        ret @{node: carg, span: sp};
-    }
-
-    fn parse_ty_constr(fn_args: ~[arg]) -> @constr {
-        let lo = self.span.lo;
-        let path = self.parse_path_without_tps();
-        let args = self.parse_unspanned_seq(
-            token::LPAREN, token::RPAREN,
-            seq_sep_trailing_disallowed(token::COMMA),
-            |p| p.parse_constr_arg(fn_args));
-        ret @spanned(lo, self.span.hi,
-                     {path: path, args: args, id: self.get_id()});
-    }
-
-    fn parse_constr_in_type() -> @ty_constr {
-        let lo = self.span.lo;
-        let path = self.parse_path_without_tps();
-        let args: ~[@ty_constr_arg] = self.parse_unspanned_seq(
-            token::LPAREN, token::RPAREN,
-            seq_sep_trailing_disallowed(token::COMMA),
-            |p| p.parse_type_constr_arg());
-        let hi = self.span.lo;
-        let tc: ty_constr_ = {path: path, args: args, id: self.get_id()};
-        ret @spanned(lo, hi, tc);
-    }
-
-
-    fn parse_constrs<T: copy>(pser: fn(parser) -> @constr_general<T>) ->
-        ~[@constr_general<T>] {
-        let mut constrs: ~[@constr_general<T>] = ~[];
-        loop {
-            let constr = pser(self);
-            vec::push(constrs, constr);
-            if self.token == token::COMMA { self.bump(); }
-            else { ret constrs; }
-        };
-    }
-
-    fn parse_type_constraints() -> ~[@ty_constr] {
-        ret self.parse_constrs(|p| p.parse_constr_in_type());
-    }
-
     fn parse_ret_ty() -> (ret_style, @ty) {
         ret if self.eat(token::RARROW) {
             let lo = self.span.lo;
@@ -519,16 +440,7 @@ class parser {
             if vec::len(elems) == 0u {
                 self.unexpected_last(token::RBRACE);
             }
-            let hi = self.span.hi;
-
-            let t = ty_rec(elems);
-            if self.token == token::COLON {
-                self.bump();
-                ty_constr(@{id: self.get_id(),
-                            node: t,
-                            span: mk_sp(lo, hi)},
-                          self.parse_type_constraints())
-            } else { t }
+            ty_rec(elems)
         } else if self.token == token::LBRACKET {
             self.expect(token::LBRACKET);
             let t = ty_vec(self.parse_mt());
@@ -970,21 +882,6 @@ class parser {
             let e = self.parse_expr();
             ex = expr_assert(e);
             hi = e.span.hi;
-        } else if self.eat_keyword(~"check") {
-            /* Should be a predicate (pure boolean function) applied to
-            arguments that are all either slot variables or literals.
-            but the typechecker enforces that. */
-            let e = self.parse_expr();
-            hi = e.span.hi;
-            ex = expr_check(checked_expr, e);
-        } else if self.eat_keyword(~"claim") {
-            /* Same rules as check, except that if check-claims
-            is enabled (a command-line flag), then the parser turns
-            claims into check */
-
-            let e = self.parse_expr();
-            hi = e.span.hi;
-            ex = expr_check(claimed_expr, e);
         } else if self.eat_keyword(~"ret") {
             if can_begin_expr(self.token) {
                 let e = self.parse_expr();
@@ -1457,12 +1354,7 @@ class parser {
         ret lhs;
     }
 
-    fn parse_if_expr_1() ->
-        {cond: @expr,
-         then: blk,
-         els: option<@expr>,
-         lo: uint,
-         hi: uint} {
+    fn parse_if_expr() -> @expr {
         let lo = self.last_span.lo;
         let cond = self.parse_expr();
         let thn = self.parse_block();
@@ -1473,18 +1365,8 @@ class parser {
             els = some(elexpr);
             hi = elexpr.span.hi;
         }
-        ret {cond: cond, then: thn, els: els, lo: lo, hi: hi};
-    }
-
-    fn parse_if_expr() -> @expr {
-        if self.eat_keyword(~"check") {
-            let q = self.parse_if_expr_1();
-            ret self.mk_expr(q.lo, q.hi,
-                             expr_if_check(q.cond, q.then, q.els));
-        } else {
-            let q = self.parse_if_expr_1();
-            ret self.mk_expr(q.lo, q.hi, expr_if(q.cond, q.then, q.els));
-        }
+        let q = {cond: cond, then: thn, els: els, lo: lo, hi: hi};
+        ret self.mk_expr(q.lo, q.hi, expr_if(q.cond, q.then, q.els));
     }
 
     fn parse_fn_expr(proto: proto) -> @expr {
@@ -1520,8 +1402,7 @@ class parser {
                                 span: self.span
                             },
                             purity: impure_fn,
-                            cf: return_val,
-                            constraints: ~[]
+                            cf: return_val
                         }
                     },
                     @~[])
@@ -2083,20 +1964,11 @@ class parser {
         let inputs = either::lefts(args_or_capture_items);
         let capture_clause = @either::rights(args_or_capture_items);
 
-        // Use the args list to translate each bound variable
-        // mentioned in a constraint to an arg index.
-        // Seems weird to do this in the parser, but I'm not sure how else to.
-        let mut constrs = ~[];
-        if self.token == token::COLON {
-            self.bump();
-            constrs = self.parse_constrs(|p| p.parse_ty_constr(inputs));
-        }
         let (ret_style, ret_ty) = self.parse_ret_ty();
         ret ({inputs: inputs,
               output: ret_ty,
               purity: purity,
-              cf: ret_style,
-              constraints: constrs}, capture_clause);
+              cf: ret_style}, capture_clause);
     }
 
     fn parse_fn_block_decl() -> (fn_decl, capture_clause) {
@@ -2118,8 +1990,7 @@ class parser {
         ret ({inputs: either::lefts(inputs_captures),
               output: output,
               purity: impure_fn,
-              cf: return_val,
-              constraints: ~[]},
+              cf: return_val},
              @either::rights(inputs_captures));
     }
 
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 7db5af23266..eb8c5b65fa5 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -306,7 +306,7 @@ fn restricted_keyword_table() -> hashmap<~str, ()> {
     let keys = ~[
         ~"alt", ~"again", ~"assert",
         ~"break",
-        ~"check", ~"claim", ~"class", ~"const", ~"copy",
+        ~"check", ~"class", ~"const", ~"copy",
         ~"do", ~"drop",
         ~"else", ~"enum", ~"export", ~"extern",
         ~"fail", ~"false", ~"fn", ~"for",
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index a0ad2647cba..1b9b0ce7f96 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -128,8 +128,7 @@ fn test_fun_to_str() {
                   node: ast::ty_nil,
                   span: ast_util::dummy_sp()},
         purity: ast::impure_fn,
-        cf: ast::return_val,
-        constraints: ~[]
+        cf: ast::return_val
     };
     assert fun_to_str(decl, "a", ~[]) == "fn a()";
 }
@@ -373,11 +372,6 @@ fn print_type_ex(s: ps, &&ty: @ast::ty, print_colons: bool) {
         print_ty_fn(s, some(proto), d, none, none);
       }
       ast::ty_path(path, _) { print_path(s, path, print_colons); }
-      ast::ty_constr(t, cs) {
-        print_type(s, t);
-        space(s.s);
-        word(s.s, constrs_str(cs, ty_constr_to_str));
-      }
       ast::ty_fixed_length(t, v) {
         print_type(s, t);
         word(s.s, ~"/");
@@ -977,9 +971,6 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
       ast::expr_if(test, blk, elseopt) {
         print_if(s, test, blk, elseopt, false);
       }
-      ast::expr_if_check(test, blk, elseopt) {
-        print_if(s, test, blk, elseopt, true);
-      }
       ast::expr_while(test, blk) {
         head(s, ~"while");
         print_maybe_parens_discrim(s, test);
@@ -1131,15 +1122,6 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
           }
         }
       }
-      ast::expr_check(m, expr) {
-        alt m {
-          ast::claimed_expr { word_nbsp(s, ~"claim"); }
-          ast::checked_expr { word_nbsp(s, ~"check"); }
-        }
-        popen(s);
-        print_expr(s, expr);
-        pclose(s);
-      }
       ast::expr_assert(expr) {
         word_nbsp(s, ~"assert");
         print_expr(s, expr);
@@ -1166,7 +1148,7 @@ fn print_expr_parens_if_not_bot(s: ps, ex: @ast::expr) {
       ast::expr_assign_op(_, _, _) | ast::expr_swap(_, _) |
       ast::expr_log(_, _, _) | ast::expr_assert(_) |
       ast::expr_call(_, _, true) |
-      ast::expr_check(_, _) | ast::expr_vstore(_, _) { true }
+      ast::expr_vstore(_, _) { true }
       _ { false }
     };
     if parens { popen(s); }
@@ -1348,9 +1330,6 @@ fn print_fn_args_and_ret(s: ps, decl: ast::fn_decl,
     popen(s);
     print_fn_args(s, decl, cap_items);
     pclose(s);
-    word(s.s, constrs_str(decl.constraints, |c| {
-        ast_fn_constr_to_str(decl, c)
-    }));
 
     maybe_print_comment(s, decl.output.span.lo);
     if decl.output.node != ast::ty_nil {
@@ -1552,7 +1531,6 @@ fn print_ty_fn(s: ps, opt_proto: option<ast::proto>,
         else { print_type(s, decl.output); }
         end(s);
     }
-    word(s.s, constrs_str(decl.constraints, ast_ty_fn_constr_to_str));
     end(s);
 }
 
@@ -1736,67 +1714,6 @@ fn next_comment(s: ps) -> option<comments::cmnt> {
     }
 }
 
-fn constr_args_to_str<T>(f: fn@(T) -> ~str,
-                         args: ~[@ast::sp_constr_arg<T>]) ->
-   ~str {
-    let mut comma = false;
-    let mut s = ~"(";
-    for args.each |a| {
-        if comma { s += ~", "; } else { comma = true; }
-        s += constr_arg_to_str::<T>(f, a.node);
-    }
-    s += ~")";
-    ret s;
-}
-
-fn constr_arg_to_str<T>(f: fn@(T) -> ~str, c: ast::constr_arg_general_<T>) ->
-   ~str {
-    alt c {
-      ast::carg_base { ret ~"*"; }
-      ast::carg_ident(i) { ret f(i); }
-      ast::carg_lit(l) { ret lit_to_str(l); }
-    }
-}
-
-// needed b/c constr_args_to_str needs
-// something that takes an alias
-// (argh)
-fn uint_to_str(&&i: uint) -> ~str { ret uint::str(i); }
-
-fn ast_ty_fn_constr_to_str(&&c: @ast::constr) -> ~str {
-    ret path_to_str(c.node.path) +
-            constr_args_to_str(uint_to_str, c.node.args);
-}
-
-fn ast_fn_constr_to_str(decl: ast::fn_decl, &&c: @ast::constr) -> ~str {
-    let arg_to_str = |a| fn_arg_idx_to_str(decl, a);
-    ret path_to_str(c.node.path) +
-            constr_args_to_str(arg_to_str, c.node.args);
-}
-
-fn ty_constr_to_str(&&c: @ast::ty_constr) -> ~str {
-    fn ty_constr_path_to_str(&&p: @ast::path) -> ~str {
-        ~"*." + path_to_str(p)
-    }
-
-    ret path_to_str(c.node.path) +
-            constr_args_to_str::<@ast::path>(ty_constr_path_to_str,
-                                             c.node.args);
-}
-
-fn constrs_str<T>(constrs: ~[T], elt: fn(T) -> ~str) -> ~str {
-    let mut s = ~"", colon = true;
-    for constrs.each |c| {
-        if colon { s += ~" : "; colon = false; } else { s += ~", "; }
-        s += elt(c);
-    }
-    ret s;
-}
-
-fn fn_arg_idx_to_str(decl: ast::fn_decl, &&idx: uint) -> ~str {
-    *decl.inputs[idx].ident
-}
-
 fn opt_proto_to_str(opt_p: option<ast::proto>) -> ~str {
     alt opt_p {
       none { ~"fn" }
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 86ba214f23c..3e61f3706f9 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -44,8 +44,6 @@ fn tps_of_fn(fk: fn_kind) -> ~[ty_param] {
 }
 
 type visitor<E> =
-    // takes the components so that one function can be
-    // generic over constr and ty_constr
     @{visit_mod: fn@(_mod, span, node_id, E, vt<E>),
       visit_view_item: fn@(@view_item, E, vt<E>),
       visit_foreign_item: fn@(@foreign_item, E, vt<E>),
@@ -59,7 +57,6 @@ type visitor<E> =
       visit_expr: fn@(@expr, E, vt<E>),
       visit_ty: fn@(@ty, E, vt<E>),
       visit_ty_params: fn@(~[ty_param], E, vt<E>),
-      visit_constr: fn@(@path, span, node_id, E, vt<E>),
       visit_fn: fn@(fn_kind, fn_decl, blk, span, node_id, E, vt<E>),
       visit_ty_method: fn@(ty_method, E, vt<E>),
       visit_trait_method: fn@(trait_method, E, vt<E>),
@@ -79,7 +76,6 @@ fn default_visitor<E>() -> visitor<E> {
           visit_expr: |a,b,c|visit_expr::<E>(a, b, c),
           visit_ty: |a,b,c|skip_ty::<E>(a, b, c),
           visit_ty_params: |a,b,c|visit_ty_params::<E>(a, b, c),
-          visit_constr: |a,b,c,d,e|visit_constr::<E>(a, b, c, d, e),
           visit_fn: |a,b,c,d,e,f,g|visit_fn::<E>(a, b, c, d, e, f, g),
           visit_ty_method: |a,b,c|visit_ty_method::<E>(a, b, c),
           visit_trait_method: |a,b,c|visit_trait_method::<E>(a, b, c),
@@ -194,21 +190,12 @@ fn visit_ty<E>(t: @ty, e: E, v: vt<E>) {
       ty_tup(ts) { for ts.each |tt| { v.visit_ty(tt, e, v); } }
       ty_fn(_, decl) {
         for decl.inputs.each |a| { v.visit_ty(a.ty, e, v); }
-        for decl.constraints.each |c| {
-            v.visit_constr(c.node.path, c.span, c.node.id, e, v);
-        }
         v.visit_ty(decl.output, e, v);
       }
       ty_path(p, _) { visit_path(p, e, v); }
       ty_fixed_length(t, _) {
         v.visit_ty(t, e, v);
       }
-      ty_constr(t, cs) {
-        v.visit_ty(t, e, v);
-        for cs.each |tc| {
-            v.visit_constr(tc.node.path, tc.span, tc.node.id, e, v);
-        }
-      }
       ty_nil |
       ty_bot |
       ty_mac(_) |
@@ -217,11 +204,6 @@ fn visit_ty<E>(t: @ty, e: E, v: vt<E>) {
     }
 }
 
-fn visit_constr<E>(_operator: @path, _sp: span, _id: node_id, _e: E,
-                   _v: vt<E>) {
-    // default
-}
-
 fn visit_path<E>(p: @path, e: E, v: vt<E>) {
     for p.types.each |tp| { v.visit_ty(tp, e, v); }
 }
@@ -272,9 +254,6 @@ fn visit_ty_params<E>(tps: ~[ty_param], e: E, v: vt<E>) {
 
 fn visit_fn_decl<E>(fd: fn_decl, e: E, v: vt<E>) {
     for fd.inputs.each |a| { v.visit_ty(a.ty, e, v); }
-    for fd.constraints.each |c| {
-        v.visit_constr(c.node.path, c.span, c.node.id, e, v);
-    }
     v.visit_ty(fd.output, e, v);
 }
 
@@ -394,9 +373,7 @@ fn visit_expr<E>(ex: @expr, e: E, v: vt<E>) {
       expr_binary(_, a, b) { v.visit_expr(a, e, v); v.visit_expr(b, e, v); }
       expr_addr_of(_, x) | expr_unary(_, x) |
       expr_loop_body(x) | expr_do_body(x) |
-      expr_check(_, x) | expr_assert(x) {
-        v.visit_expr(x, e, v);
-      }
+      expr_assert(x) { v.visit_expr(x, e, v); }
       expr_lit(_) { }
       expr_cast(x, t) { v.visit_expr(x, e, v); v.visit_ty(t, e, v); }
       expr_if(x, b, eo) {
@@ -404,11 +381,6 @@ fn visit_expr<E>(ex: @expr, e: E, v: vt<E>) {
         v.visit_block(b, e, v);
         visit_expr_opt(eo, e, v);
       }
-      expr_if_check(x, b, eo) {
-        v.visit_expr(x, e, v);
-        v.visit_block(b, e, v);
-        visit_expr_opt(eo, e, v);
-      }
       expr_while(x, b) { v.visit_expr(x, e, v); v.visit_block(b, e, v); }
       expr_loop(b) { v.visit_block(b, e, v); }
       expr_alt(x, arms, _) {
@@ -460,8 +432,6 @@ fn visit_arm<E>(a: arm, e: E, v: vt<E>) {
 // calls the given functions on the nodes.
 
 type simple_visitor =
-    // takes the components so that one function can be
-    // generic over constr and ty_constr
     @{visit_mod: fn@(_mod, span, node_id),
       visit_view_item: fn@(@view_item),
       visit_foreign_item: fn@(@foreign_item),
@@ -475,7 +445,6 @@ type simple_visitor =
       visit_expr: fn@(@expr),
       visit_ty: fn@(@ty),
       visit_ty_params: fn@(~[ty_param]),
-      visit_constr: fn@(@path, span, node_id),
       visit_fn: fn@(fn_kind, fn_decl, blk, span, node_id),
       visit_ty_method: fn@(ty_method),
       visit_trait_method: fn@(trait_method),
@@ -497,7 +466,6 @@ fn default_simple_visitor() -> simple_visitor {
           visit_expr: fn@(_e: @expr) { },
           visit_ty: simple_ignore_ty,
           visit_ty_params: fn@(_ps: ~[ty_param]) {},
-          visit_constr: fn@(_p: @path, _sp: span, _id: node_id) { },
           visit_fn: fn@(_fk: fn_kind, _d: fn_decl, _b: blk, _sp: span,
                         _id: node_id) { },
           visit_ty_method: fn@(_m: ty_method) { },
@@ -572,11 +540,6 @@ fn mk_simple_visitor(v: simple_visitor) -> vt<()> {
         f(ps);
         visit_ty_params(ps, e, v);
     }
-    fn v_constr(f: fn@(@path, span, node_id), pt: @path, sp: span,
-                id: node_id, &&e: (), v: vt<()>) {
-        f(pt, sp, id);
-        visit_constr(pt, sp, id, e, v);
-    }
     fn v_fn(f: fn@(fn_kind, fn_decl, blk, span, node_id),
             fk: fn_kind, decl: fn_decl, body: blk, sp: span,
             id: node_id, &&e: (), v: vt<()>) {
@@ -610,8 +573,6 @@ fn mk_simple_visitor(v: simple_visitor) -> vt<()> {
                 visit_ty: visit_ty,
                 visit_ty_params: |a,b,c|
                     v_ty_params(v.visit_ty_params, a, b, c),
-                visit_constr: |a,b,c,d,e|
-                    v_constr(v.visit_constr, a, b, c, d, e),
                 visit_fn: |a,b,c,d,e,f,g|
                     v_fn(v.visit_fn, a, b, c, d, e, f, g),
                 visit_ty_method: |a,b,c|