Skip to content

Commit a4e378b

Browse files
committed
---
yaml --- r: 1952 b: refs/heads/master c: 1eeedbd h: refs/heads/master v: v3
1 parent 4c138ff commit a4e378b

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
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: bdea34387945aee7d18981a8c59f5b04beb560fc
2+
refs/heads/master: 1eeedbd00865fbc8c2650b8e2feba0b6e7f290dc

trunk/src/comp/middle/trans.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ fn static_size_of_tag(@crate_ctxt cx, @ty.t t) -> uint {
11031103
}
11041104

11051105
// Pull the type parameters out of the corresponding tag item.
1106-
let vec[ast.ty_param] ty_params = tag_ty_params(cx, tid);
1106+
let vec[ast.def_id] ty_params = tag_ty_params(cx, tid);
11071107

11081108
// Compute max(variant sizes).
11091109
auto max_size = 0u;
@@ -1905,12 +1905,8 @@ fn variant_types(@crate_ctxt cx, &ast.variant v) -> vec[@ty.t] {
19051905
}
19061906

19071907
// Returns the type parameters of a tag.
1908-
fn tag_ty_params(@crate_ctxt cx, ast.def_id id) -> vec[ast.ty_param] {
1909-
check (cx.items.contains_key(id));
1910-
alt (cx.items.get(id).node) {
1911-
case (ast.item_tag(_, _, ?tps, _)) { ret tps; }
1912-
}
1913-
fail; // not reached
1908+
fn tag_ty_params(@crate_ctxt cx, ast.def_id id) -> vec[ast.def_id] {
1909+
ret ty.lookup_generic_item_type(cx.sess, cx.type_cache, id)._0;
19141910
}
19151911

19161912
// Returns the variants in a tag.

trunk/src/comp/middle/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,15 +1664,15 @@ fn replace_type_params(@t typ, hashmap[ast.def_id,@t] param_map) -> @t {
16641664
// Substitutes the type parameters specified by @ty_params with the
16651665
// corresponding types in @bound in the given type. The two vectors must have
16661666
// the same length.
1667-
fn substitute_ty_params(vec[ast.ty_param] ty_params, vec[@t] bound, @t ty)
1667+
fn substitute_ty_params(vec[ast.def_id] ty_params, vec[@t] bound, @t ty)
16681668
-> @t {
1669-
auto ty_param_len = _vec.len[ast.ty_param](ty_params);
1669+
auto ty_param_len = _vec.len[ast.def_id](ty_params);
16701670
check (ty_param_len == _vec.len[@t](bound));
16711671

16721672
auto bindings = common.new_def_hash[@t]();
16731673
auto i = 0u;
16741674
while (i < ty_param_len) {
1675-
bindings.insert(ty_params.(i).id, bound.(i));
1675+
bindings.insert(ty_params.(i), bound.(i));
16761676
i += 1u;
16771677
}
16781678

0 commit comments

Comments
 (0)