diff options
| author | Patrick Walton <[email protected]> | 2011-05-10 17:27:30 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-05-10 17:27:59 -0700 |
| commit | 10c926652515052000e44ef4ac10e6b4ebbc6e3a (patch) | |
| tree | bce087c37ed3f7b74264c67b3b0b62757e910987 /src/comp/middle | |
| parent | Remove a couple more spurious 'mutable' value qualifiers from macos_OS.rs. (diff) | |
| download | rust-10c926652515052000e44ef4ac10e6b4ebbc6e3a.tar.xz rust-10c926652515052000e44ef4ac10e6b4ebbc6e3a.zip | |
rustc: Number everything with an annotation
Diffstat (limited to 'src/comp/middle')
| -rw-r--r-- | src/comp/middle/trans.rs | 4 | ||||
| -rw-r--r-- | src/comp/middle/ty.rs | 8 | ||||
| -rw-r--r-- | src/comp/middle/typeck.rs | 8 | ||||
| -rw-r--r-- | src/comp/middle/typestate_check.rs | 32 |
4 files changed, 26 insertions, 26 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 853b9965..98e3b14e 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -3090,7 +3090,7 @@ fn node_ann_type(@crate_ctxt cx, &ast.ann a) -> ty.t { fn node_ann_ty_params(&ast.ann a) -> vec[ty.t] { alt (a) { - case (ast.ann_none) { + case (ast.ann_none(_)) { log_err "missing type annotation"; fail; } @@ -4106,7 +4106,7 @@ fn lval_generic_fn(@block_ctxt cx, auto monoty; let vec[ty.t] tys; alt (ann) { - case (ast.ann_none) { + case (ast.ann_none(_)) { cx.fcx.lcx.ccx.sess.bug("no type annotation for path!"); fail; } diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 797b1ee0..5c2dc425 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1557,7 +1557,7 @@ fn eq_ty(&t a, &t b) -> bool { fn ann_to_type(&ast.ann ann) -> t { alt (ann) { - case (ast.ann_none) { + case (ast.ann_none(_)) { log_err "ann_to_type() called on node with no type"; fail; } @@ -1569,7 +1569,7 @@ fn ann_to_type(&ast.ann ann) -> t { fn ann_to_type_params(&ast.ann ann) -> vec[t] { alt (ann) { - case (ast.ann_none) { + case (ast.ann_none(_)) { log_err "ann_to_type_params() called on node with no type params"; fail; } @@ -1591,7 +1591,7 @@ fn ann_to_monotype(ctxt cx, ast.ann a) -> t { // TODO: Refactor to use recursive pattern matching when we're more // confident that it works. alt (a) { - case (ast.ann_none) { + case (ast.ann_none(_)) { log_err "ann_to_monotype() called on expression with no type!"; fail; } @@ -1905,7 +1905,7 @@ fn expr_ty_params_and_ty(&ctxt cx, &@ast.expr expr) -> tup(vec[t], t) { fn expr_has_ty_params(&@ast.expr expr) -> bool { // FIXME: Rewrite using complex patterns when they're trustworthy. alt (expr_ann(expr)) { - case (ast.ann_none) { fail; } + case (ast.ann_none(_)) { fail; } case (ast.ann_type(_, ?tps_opt, _)) { ret !Option.is_none[vec[t]](tps_opt); } diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index 0df6bc4b..7e948376 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -1396,7 +1396,7 @@ mod Pushdown { // provided by the programmer. auto ty_params_opt; alt (ann) { - case (ast.ann_none) { + case (ast.ann_none(_)) { log_err "pushdown_expr(): no type annotation for " + "path expr; did you pass it to check_expr()?"; fail; @@ -1558,7 +1558,7 @@ fn resolve_local_types_in_annotation(&Option.t[@fn_ctxt] env, &ast.ann ann) auto fcx = Option.get[@fn_ctxt](env); alt (ann) { - case (ast.ann_none) { + case (ast.ann_none(_)) { log "warning: no type for expression"; ret ann; } @@ -2506,7 +2506,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast.expr expr) -> @ast.expr { Vec.push[field](fields_t, rec(ident=f.ident, mt=expr_mt)); } - auto ann = ast.ann_none; + auto ann; alt (base) { case (none[@ast.expr]) { @@ -2717,7 +2717,7 @@ fn check_decl_local(&@fn_ctxt fcx, &@ast.decl decl) -> @ast.decl { auto a_res = local.ann; alt (a_res) { - case (ann_none) { + case (ann_none(_)) { a_res = triv_ann(t); } case (_) {} diff --git a/src/comp/middle/typestate_check.rs b/src/comp/middle/typestate_check.rs index 7a9f9da7..4346db02 100644 --- a/src/comp/middle/typestate_check.rs +++ b/src/comp/middle/typestate_check.rs @@ -392,7 +392,7 @@ fn mk_f_to_fn_info(@ast.crate c) -> fn_info_map { /**** Helpers ****/ fn ann_to_ts_ann(ann a, uint nv) -> ts_ann { alt (a) { - case (ann_none) { ret empty_ann(nv); } + case (ann_none(_)) { ret empty_ann(nv); } case (ann_type(_,_,?t)) { alt (t) { /* Kind of inconsistent. empty_ann()s everywhere @@ -406,7 +406,7 @@ fn ann_to_ts_ann(ann a, uint nv) -> ts_ann { fn ann_to_ts_ann_fail(ann a) -> Option.t[@ts_ann] { alt (a) { - case (ann_none) { + case (ann_none(_)) { log("ann_to_ts_ann_fail: didn't expect ann_none here"); fail; } @@ -418,7 +418,7 @@ fn ann_to_ts_ann_fail(ann a) -> Option.t[@ts_ann] { fn ann_to_ts_ann_fail_more(ann a) -> @ts_ann { alt (a) { - case (ann_none) { + case (ann_none(_)) { log("ann_to_ts_ann_fail: didn't expect ann_none here"); fail; } @@ -450,7 +450,7 @@ fn stmt_to_ann(&stmt s) -> Option.t[@ts_ann] { /* fails if e has no annotation */ fn expr_states(@expr e) -> pre_and_post_state { alt (expr_ann(e)) { - case (ann_none) { + case (ann_none(_)) { log_err "expr_pp: the impossible happened (no annotation)"; fail; } @@ -471,7 +471,7 @@ fn expr_states(@expr e) -> pre_and_post_state { /* fails if e has no annotation */ fn expr_pp(@expr e) -> pre_and_post { alt (expr_ann(e)) { - case (ann_none) { + case (ann_none(_)) { log_err "expr_pp: the impossible happened (no annotation)"; fail; } @@ -505,7 +505,7 @@ fn stmt_pp(&stmt s) -> pre_and_post { /* FIXME: factor out code in the following two functions (block_ts_ann) */ fn block_pp(&block b) -> pre_and_post { alt (b.node.a) { - case (ann_none) { + case (ann_none(_)) { log_err "block_pp: the impossible happened (no ann)"; fail; } @@ -525,7 +525,7 @@ fn block_pp(&block b) -> pre_and_post { fn block_states(&block b) -> pre_and_post_state { alt (b.node.a) { - case (ann_none) { + case (ann_none(_)) { log_err "block_pp: the impossible happened (no ann)"; fail; } @@ -605,7 +605,7 @@ fn block_poststate(&block b) -> poststate { /* returns a new annotation where the pre_and_post is p */ fn with_pp(ann a, pre_and_post p) -> ann { alt (a) { - case (ann_none) { + case (ann_none(_)) { log("with_pp: the impossible happened"); fail; /* shouldn't happen b/c code is typechecked */ } @@ -1300,7 +1300,7 @@ fn set_prestate_ann(@ann a, prestate pre) -> bool { assert (! is_none[@ts_ann](ts_a)); ret set_prestate(get[@ts_ann](ts_a), pre); } - case (ann_none) { + case (ann_none(_)) { log("set_prestate_ann: expected an ann_type here"); fail; } @@ -1314,7 +1314,7 @@ fn extend_prestate_ann(ann a, prestate pre) -> bool { assert (! is_none[@ts_ann](ts_a)); ret extend_prestate((get[@ts_ann](ts_a)).states.prestate, pre); } - case (ann_none) { + case (ann_none(_)) { log("set_prestate_ann: expected an ann_type here"); fail; } @@ -1327,7 +1327,7 @@ fn set_poststate_ann(ann a, poststate post) -> bool { assert (! is_none[@ts_ann](ts_a)); ret set_poststate(get[@ts_ann](ts_a), post); } - case (ann_none) { + case (ann_none(_)) { log("set_poststate_ann: expected an ann_type here"); fail; } @@ -1340,7 +1340,7 @@ fn extend_poststate_ann(ann a, poststate post) -> bool { assert (! is_none[@ts_ann](ts_a)); ret extend_poststate((*get[@ts_ann](ts_a)).states.poststate, post); } - case (ann_none) { + case (ann_none(_)) { log("set_poststate_ann: expected an ann_type here"); fail; } @@ -1360,7 +1360,7 @@ fn set_pre_and_post(&ann a, pre_and_post pp) -> () { set_precondition(t, pp.precondition); set_postcondition(t, pp.postcondition); } - case (ann_none) { + case (ann_none(_)) { log_err("set_pre_and_post: expected an ann_type here"); fail; } @@ -2042,7 +2042,7 @@ fn check_obj_state(&fn_info_map f_info_map, &vec[obj_field] fields, fn init_ann(&fn_info fi, &ann a) -> ann { alt (a) { - case (ann_none) { + case (ann_none(_)) { // log("init_ann: shouldn't see ann_none"); // fail; log("warning: init_ann: saw ann_none"); @@ -2058,7 +2058,7 @@ fn init_ann(&fn_info fi, &ann a) -> ann { fn init_blank_ann(&() ignore, &ann a) -> ann { alt (a) { - case (ann_none) { + case (ann_none(_)) { // log("init_blank_ann: shouldn't see ann_none"); //fail; log("warning: init_blank_ann: saw ann_none"); @@ -2074,7 +2074,7 @@ fn init_block(&fn_info fi, &span sp, &block_ b) -> block { log("init_block:"); log_block(respan(sp, b)); alt(b.a) { - case (ann_none) { + case (ann_none(_)) { log("init_block: shouldn't see ann_none"); fail; } |