Skip to content

Commit a517585

Browse files
committed
---
yaml --- r: 2794 b: refs/heads/master c: 9f95538 h: refs/heads/master v: v3
1 parent 2a87ddf commit a517585

File tree

5 files changed

+7
-53
lines changed

5 files changed

+7
-53
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 2561b01211569c376b05f4c8d1434a0e527ac950
2+
refs/heads/master: 9f9553846235f4a94b68901bb491e73cb837c191

trunk/src/comp/front/ast.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ type def_id = tup(crate_num, def_num);
2020

2121
type ty_param = ident;
2222

23-
// Annotations added during successive passes.
24-
type ann = rec(uint id,
25-
middle::ty::t ty,
26-
option::t[vec[middle::ty::t]] tps);
23+
type ann = rec(uint id);
2724

2825
tag def {
2926
def_fn(def_id);

trunk/src/comp/front/parser.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,7 @@ fn new_parser(session::session sess,
146146
fn get_chpos() -> uint {ret rdr.get_chpos();}
147147

148148
fn get_ann() -> ast::ann {
149-
// TODO: Remove ty and tps, which should be unused
150-
// by now.
151-
auto rv = rec(id=next_ann_var, ty=0u,
152-
tps=none[vec[middle::ty::t]]);
149+
auto rv = rec(id=next_ann_var);
153150
next_ann_var += 1u;
154151
ret rv;
155152
}

trunk/src/comp/middle/ty.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,28 +1572,6 @@ fn ann_to_monotype(&ctxt cx, ast::ann a) -> t {
15721572
}
15731573

15741574

1575-
// Turns a type and optional type parameters into an annotation, using
1576-
// defaults for other fields.
1577-
fn mk_ann_type(uint node_id, t typ, option::t[vec[t]] tps) -> ast::ann {
1578-
ret rec(id=node_id, ty=typ, tps=tps);
1579-
}
1580-
1581-
// Turns a type into an annotation, using defaults for other fields.
1582-
fn triv_ann(uint node_id, t typ) -> ast::ann {
1583-
ret mk_ann_type(node_id, typ, none[vec[t]]);
1584-
}
1585-
1586-
// Creates a nil type annotation.
1587-
fn plain_ann(uint node_id, ctxt tcx) -> ast::ann {
1588-
ret triv_ann(node_id, mk_nil(tcx));
1589-
}
1590-
1591-
// Creates a _|_ type annotation.
1592-
fn bot_ann(uint node_id, ctxt tcx) -> ast::ann {
1593-
ret triv_ann(node_id, mk_bot(tcx));
1594-
}
1595-
1596-
15971575
// Returns the number of distinct type parameters in the given type.
15981576
fn count_ty_params(&ctxt cx, t ty) -> uint {
15991577
fn counter(&ctxt cx, @mutable vec[uint] param_indices, t ty) {

trunk/src/comp/middle/typeck.rs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,13 @@ import middle::ty::block_ty;
1616
import middle::ty::expr_ty;
1717
import middle::ty::field;
1818
import middle::ty::method;
19-
import middle::ty::mk_ann_type;
2019
import middle::ty::mo_val;
2120
import middle::ty::mo_alias;
2221
import middle::ty::mo_either;
2322
import middle::ty::node_type_table;
2423
import middle::ty::pat_ty;
2524
import middle::ty::path_to_str;
26-
import middle::ty::plain_ann;
27-
import middle::ty::bot_ann;
2825
import middle::ty::struct;
29-
import middle::ty::triv_ann;
3026
import middle::ty::ty_param_substs_opt_and_ty;
3127
import middle::ty::ty_to_str;
3228
import middle::ty::type_is_integral;
@@ -645,9 +641,7 @@ mod collect {
645641

646642
fn get_tag_variant_types(&@ctxt cx, &ast::def_id tag_id,
647643
&vec[ast::variant] variants,
648-
&vec[ast::ty_param] ty_params)
649-
-> vec[ast::variant] {
650-
let vec[ast::variant] result = [];
644+
&vec[ast::ty_param] ty_params) {
651645

652646
// Create a set of parameter types shared among all the variants.
653647
let vec[ty::t] ty_param_tys = [];
@@ -682,17 +676,10 @@ mod collect {
682676

683677
auto tpt = tup(ty_param_count, result_ty);
684678
cx.tcx.tcache.insert(variant.node.id, tpt);
685-
auto variant_t = rec(
686-
ann=triv_ann(variant.node.ann.id, result_ty)
687-
with variant.node
688-
);
689679
write::ty_only(cx.tcx, variant.node.ann.id, result_ty);
690-
result += [common::respan(variant.span, variant_t)];
691680
}
692-
693-
ret result;
694681
}
695-
682+
696683
fn get_obj_method_types(&@ctxt cx, &ast::_obj object) -> vec[ty::method] {
697684
ret vec::map[@ast::method,method](bind ty_of_method(cx, _),
698685
object.methods);
@@ -1184,13 +1171,10 @@ mod pushdown {
11841171
let ty_param_substs_and_ty res_t = demand::full(scx, pat.span,
11851172
expected, tt, tps, NO_AUTODEREF);
11861173

1187-
auto a_1 = mk_ann_type(ann.id, res_t._1,
1188-
some[vec[ty::t]](res_t._0));
1189-
11901174
// TODO: push down type from "expected".
11911175
write::ty_fixup(scx, ann.id,
11921176
ty::ann_to_ty_param_substs_opt_and_ty
1193-
(scx.fcx.ccx.tcx.node_types, a_1));
1177+
(scx.fcx.ccx.tcx.node_types, ann));
11941178
}
11951179
}
11961180
}
@@ -1691,8 +1675,7 @@ fn check_pat(&@stmt_ctxt scx, &@ast::pat pat) {
16911675
}
16921676
case (ast::pat_bind(?id, ?def_id, ?a)) {
16931677
auto typ = next_ty_var(scx);
1694-
auto ann = triv_ann(a.id, typ);
1695-
write::ty_only_fixup(scx, ann.id, typ);
1678+
write::ty_only_fixup(scx, a.id, typ);
16961679
}
16971680
case (ast::pat_tag(?p, ?subpats, ?old_ann)) {
16981681
auto vdef = ast::variant_def_ids
@@ -1882,7 +1865,6 @@ fn check_expr(&@stmt_ctxt scx, &@ast::expr expr) {
18821865
pushdown::pushdown_expr(scx, lhs_t1, rhs);
18831866
auto rhs_t1 = expr_ty(scx.fcx.ccx.tcx, rhs);
18841867

1885-
auto ann = triv_ann(a.id, rhs_t1);
18861868
write::ty_only_fixup(scx, a.id, rhs_t1);
18871869
}
18881870

0 commit comments

Comments
 (0)