Skip to content

Commit 956afd4

Browse files
committed
---
yaml --- r: 3616 b: refs/heads/master c: 4c38430 h: refs/heads/master v: v3
1 parent ffe99b6 commit 956afd4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
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: 5703bd1760366422019e1b6d3f432e46bae4dd1b
2+
refs/heads/master: 4c384304e9c37590a2e65d4803b7abef375490a4

trunk/src/comp/middle/ty.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,13 +2761,16 @@ fn type_err_to_str(&ty::type_err err) -> str {
27612761
// Converts type parameters in a type to type variables and returns the
27622762
// resulting type along with a list of type variable IDs.
27632763
fn bind_params_in_type(&span sp, &ctxt cx, fn() -> int next_ty_var, t typ,
2764-
uint ty_param_count) -> tup(vec[int], t) {
2765-
let vec[int] param_var_ids = [];
2764+
uint ty_param_count) -> tup(int[], t) {
2765+
let @mutable int[] param_var_ids = @mutable ~[];
27662766
auto i = 0u;
2767-
while (i < ty_param_count) { param_var_ids += [next_ty_var()]; i += 1u; }
2768-
fn binder(span sp, ctxt cx, vec[int] param_var_ids,
2767+
while (i < ty_param_count) {
2768+
*param_var_ids += ~[next_ty_var()];
2769+
i += 1u;
2770+
}
2771+
fn binder(span sp, ctxt cx, @mutable int[] param_var_ids,
27692772
fn() -> int next_ty_var, uint index) -> t {
2770-
if (index < vec::len(param_var_ids)) {
2773+
if (index < ivec::len(*param_var_ids)) {
27712774
ret mk_var(cx, param_var_ids.(index));
27722775
}
27732776
else {
@@ -2777,7 +2780,7 @@ fn bind_params_in_type(&span sp, &ctxt cx, fn() -> int next_ty_var, t typ,
27772780
auto new_typ =
27782781
fold_ty(cx, fm_param(bind binder(sp, cx, param_var_ids,
27792782
next_ty_var, _)), typ);
2780-
ret tup(param_var_ids, new_typ);
2783+
ret tup(*param_var_ids, new_typ);
27812784
}
27822785

27832786

0 commit comments

Comments
 (0)