Skip to content

Commit 6020607

Browse files
committed
---
yaml --- r: 3640 b: refs/heads/master c: 2fd46b5 h: refs/heads/master v: v3
1 parent ee3ef4f commit 6020607

File tree

4 files changed

+34
-36
lines changed

4 files changed

+34
-36
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: cb2018c6db7dea9c3ff5e477c017a2677c0e15a7
2+
refs/heads/master: 2fd46b54fb7e211fed34cff4833efdc4a7ab5752

trunk/src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4891,7 +4891,7 @@ fn lval_generic_fn(&@block_ctxt cx, &ty::ty_param_count_and_ty tpt,
48914891
lv = trans_external_path(cx, fn_id, tpt);
48924892
}
48934893
auto tys = ty::node_id_to_type_params(cx.fcx.lcx.ccx.tcx, id);
4894-
if (vec::len[ty::t](tys) != 0u) {
4894+
if (std::ivec::len[ty::t](tys) != 0u) {
48954895
auto bcx = lv.res.bcx;
48964896
let vec[ValueRef] tydescs = [];
48974897
let vec[option::t[@tydesc_info]] tis = [];

trunk/src/comp/middle/ty.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ const uint idx_first_others = 21u;
351351

352352
type type_store = interner::interner[raw_t];
353353

354-
type ty_param_substs_opt_and_ty = tup(option::t[vec[ty::t]], ty::t);
354+
type ty_param_substs_opt_and_ty = tup(option::t[ty::t[]], ty::t);
355355

356356
type node_type_table =
357357
@smallintmap::smallintmap[ty::ty_param_substs_opt_and_ty];
@@ -1748,16 +1748,16 @@ fn node_id_to_type(&ctxt cx, &ast::node_id id) -> t {
17481748
ret node_id_to_ty_param_substs_opt_and_ty(cx, id)._1;
17491749
}
17501750

1751-
fn node_id_to_type_params(&ctxt cx, &ast::node_id id) -> vec[t] {
1751+
fn node_id_to_type_params(&ctxt cx, &ast::node_id id) -> t[] {
17521752
alt (node_id_to_ty_param_substs_opt_and_ty(cx, id)._0) {
1753-
case (none) { let vec[t] result = []; ret result; }
1753+
case (none) { ret ~[]; }
17541754
case (some(?tps)) { ret tps; }
17551755
}
17561756
}
17571757

17581758
fn node_id_has_type_params(&ctxt cx, &ast::node_id id) -> bool {
17591759
auto tpt = node_id_to_ty_param_substs_opt_and_ty(cx, id);
1760-
ret !option::is_none[vec[t]](tpt._0);
1760+
ret !option::is_none[t[]](tpt._0);
17611761
}
17621762

17631763

@@ -1883,7 +1883,7 @@ fn expr_ty(&ctxt cx, &@ast::expr expr) -> t {
18831883
ret node_id_to_monotype(cx, expr.id);
18841884
}
18851885

1886-
fn expr_ty_params_and_ty(&ctxt cx, &@ast::expr expr) -> tup(vec[t], t) {
1886+
fn expr_ty_params_and_ty(&ctxt cx, &@ast::expr expr) -> tup(t[], t) {
18871887
ret tup(node_id_to_type_params(cx, expr.id),
18881888
node_id_to_type(cx, expr.id));
18891889
}

trunk/src/comp/middle/typeck.rs

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
159159
auto ty_substs_opt;
160160
auto ty_substs_len = vec::len[@ast::ty](pth.node.types);
161161
if (ty_substs_len > 0u) {
162-
let vec[ty::t] ty_substs = [];
162+
let ty::t[] ty_substs = ~[];
163163
auto i = 0u;
164164
while (i < ty_substs_len) {
165165
// TODO: Report an error if the number of type params in the item
@@ -168,10 +168,10 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
168168
auto ty_var = ty::mk_var(fcx.ccx.tcx, ty_param_vars.(i));
169169
auto ty_subst = ast_ty_to_ty_crate(fcx.ccx, pth.node.types.(i));
170170
auto res_ty = demand::simple(fcx, pth.span, ty_var, ty_subst);
171-
ty_substs += [res_ty];
171+
ty_substs += ~[res_ty];
172172
i += 1u;
173173
}
174-
ty_substs_opt = some[vec[ty::t]](ty_substs);
174+
ty_substs_opt = some[ty::t[]](ty_substs);
175175
if (ty_param_count == 0u) {
176176
fcx.ccx.tcx.sess.span_fatal(sp,
177177
"this item does not take type " +
@@ -181,13 +181,13 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
181181
} else {
182182
// We will acquire the type parameters through unification.
183183

184-
let vec[ty::t] ty_substs = [];
184+
let ty::t[] ty_substs = ~[];
185185
auto i = 0u;
186186
while (i < ty_param_count) {
187-
ty_substs += [ty::mk_var(fcx.ccx.tcx, ty_param_vars.(i))];
187+
ty_substs += ~[ty::mk_var(fcx.ccx.tcx, ty_param_vars.(i))];
188188
i += 1u;
189189
}
190-
ty_substs_opt = some[vec[ty::t]](ty_substs);
190+
ty_substs_opt = some[ty::t[]](ty_substs);
191191
}
192192
ret tup(ty_substs_opt, tpt._1);
193193
}
@@ -437,23 +437,23 @@ mod write {
437437

438438
// Writes a type with no type parameters into the node type table.
439439
fn ty_only(&ty::ctxt tcx, ast::node_id node_id, ty::t typ) {
440-
ret ty(tcx, node_id, tup(none[vec[ty::t]], typ));
440+
ret ty(tcx, node_id, tup(none[ty::t[]], typ));
441441
}
442442

443443
// Writes a type with no type parameters into the node type table. This
444444
// function allows for the possibility of type variables.
445445
fn ty_only_fixup(@fn_ctxt fcx, ast::node_id node_id, ty::t typ) {
446-
ret ty_fixup(fcx, node_id, tup(none[vec[ty::t]], typ));
446+
ret ty_fixup(fcx, node_id, tup(none[ty::t[]], typ));
447447
}
448448

449449
// Writes a nil type into the node type table.
450450
fn nil_ty(&ty::ctxt tcx, ast::node_id node_id) {
451-
ret ty(tcx, node_id, tup(none[vec[ty::t]], ty::mk_nil(tcx)));
451+
ret ty(tcx, node_id, tup(none[ty::t[]], ty::mk_nil(tcx)));
452452
}
453453

454454
// Writes the bottom type into the node type table.
455455
fn bot_ty(&ty::ctxt tcx, ast::node_id node_id) {
456-
ret ty(tcx, node_id, tup(none[vec[ty::t]], ty::mk_bot(tcx)));
456+
ret ty(tcx, node_id, tup(none[ty::t[]], ty::mk_bot(tcx)));
457457
}
458458
}
459459

@@ -914,24 +914,22 @@ fn resolve_type_vars_if_possible(&@fn_ctxt fcx, ty::t typ) -> ty::t {
914914

915915
// Demands - procedures that require that two types unify and emit an error
916916
// message if they don't.
917-
type ty_param_substs_and_ty = tup(vec[ty::t], ty::t);
917+
type ty_param_substs_and_ty = tup(ty::t[], ty::t);
918918

919919
mod demand {
920920
fn simple(&@fn_ctxt fcx, &span sp, &ty::t expected, &ty::t actual) ->
921921
ty::t {
922-
let vec[ty::t] tps = [];
923-
ret full(fcx, sp, expected, actual, tps, NO_AUTODEREF)._1;
922+
ret full(fcx, sp, expected, actual, ~[], NO_AUTODEREF)._1;
924923
}
925924
fn autoderef(&@fn_ctxt fcx, &span sp, &ty::t expected, &ty::t actual,
926925
autoderef_kind adk) -> ty::t {
927-
let vec[ty::t] tps = [];
928-
ret full(fcx, sp, expected, actual, tps, adk)._1;
926+
ret full(fcx, sp, expected, actual, ~[], adk)._1;
929927
}
930928

931929
// Requires that the two types unify, and prints an error message if they
932930
// don't. Returns the unified type and the type parameter substitutions.
933931
fn full(&@fn_ctxt fcx, &span sp, &ty::t expected, &ty::t actual,
934-
&vec[ty::t] ty_param_substs_0, autoderef_kind adk) ->
932+
&ty::t[] ty_param_substs_0, autoderef_kind adk) ->
935933
ty_param_substs_and_ty {
936934
auto expected_1 = expected;
937935
auto actual_1 = actual;
@@ -956,10 +954,10 @@ mod demand {
956954
fn mk_result(&@fn_ctxt fcx, &ty::t result_ty,
957955
&vec[int] ty_param_subst_var_ids,
958956
uint implicit_boxes) -> ty_param_substs_and_ty {
959-
let vec[ty::t] result_ty_param_substs = [];
957+
let ty::t[] result_ty_param_substs = ~[];
960958
for (int var_id in ty_param_subst_var_ids) {
961959
auto tp_subst = ty::mk_var(fcx.ccx.tcx, var_id);
962-
result_ty_param_substs += [tp_subst];
960+
result_ty_param_substs += ~[tp_subst];
963961
}
964962
ret tup(result_ty_param_substs,
965963
add_boxes(fcx.ccx, implicit_boxes, result_ty));
@@ -1061,21 +1059,21 @@ mod writeback {
10611059
};
10621060
auto new_substs_opt;
10631061
alt (tpot._0) {
1064-
case (none[vec[ty::t]]) { new_substs_opt = none[vec[ty::t]]; }
1065-
case (some[vec[ty::t]](?substs)) {
1066-
let vec[ty::t] new_substs = [];
1062+
case (none[ty::t[]]) { new_substs_opt = none[ty::t[]]; }
1063+
case (some[ty::t[]](?substs)) {
1064+
let ty::t[] new_substs = ~[];
10671065
for (ty::t subst in substs) {
10681066
alt (resolve_type_vars_in_type(fcx, sp, subst)) {
10691067
case (some(?t)) {
1070-
new_substs += [t];
1068+
new_substs += ~[t];
10711069
}
10721070
case (none) {
10731071
wbcx.success = false;
10741072
ret;
10751073
}
10761074
}
10771075
}
1078-
new_substs_opt = some[vec[ty::t]](new_substs);
1076+
new_substs_opt = some[ty::t[]](new_substs);
10791077
}
10801078
}
10811079
write::ty(fcx.ccx.tcx, id, tup(new_substs_opt, new_ty));
@@ -1266,11 +1264,11 @@ fn gather_locals(&@crate_ctxt ccx, &ast::fn_decl decl, &ast::block body,
12661264

12671265
// AST fragment utilities
12681266
fn replace_expr_type(&@fn_ctxt fcx, &@ast::expr expr,
1269-
&tup(vec[ty::t], ty::t) new_tyt) {
1267+
&tup(ty::t[], ty::t) new_tyt) {
12701268
auto new_tps;
12711269
if (ty::expr_has_ty_params(fcx.ccx.tcx, expr)) {
1272-
new_tps = some[vec[ty::t]](new_tyt._0);
1273-
} else { new_tps = none[vec[ty::t]]; }
1270+
new_tps = some[ty::t[]](new_tyt._0);
1271+
} else { new_tps = none[ty::t[]]; }
12741272
write::ty_fixup(fcx, expr.id, tup(new_tps, new_tyt._1));
12751273
}
12761274

@@ -1327,13 +1325,13 @@ fn check_pat(&@fn_ctxt fcx, &@ast::pat pat, ty::t expected) {
13271325
path_tpot);
13281326

13291327
// FIXME: Remove this ivec->vec conversion.
1330-
auto tps_vec = [];
1331-
for (ty::t tp in expected_tps) { tps_vec += [tp]; }
1328+
auto tps_vec = ~[];
1329+
for (ty::t tp in expected_tps) { tps_vec += ~[tp]; }
13321330

13331331
auto path_tpt =
13341332
demand::full(fcx, pat.span, expected, ctor_ty, tps_vec,
13351333
NO_AUTODEREF);
1336-
path_tpot = tup(some[vec[ty::t]](path_tpt._0), path_tpt._1);
1334+
path_tpot = tup(some[ty::t[]](path_tpt._0), path_tpt._1);
13371335
// Get the number of arguments in this tag variant.
13381336

13391337
auto arg_types =

0 commit comments

Comments
 (0)