Skip to content

Commit a400f13

Browse files
committed
---
yaml --- r: 11562 b: refs/heads/master c: 0398456 h: refs/heads/master v: v3
1 parent 832bbcf commit a400f13

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 072b0155151329b323540d521bffe3eb49873799
2+
refs/heads/master: 03984561d43130cb8d51025604ac882470d47e3c
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/comp/middle/typeck.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,11 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
420420

421421
fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
422422
-> ty::ty_param_bounds_and_ty {
423-
alt tcx.tcache.find(local_def(it.id)) {
423+
let def_id = local_def(it.id);
424+
alt tcx.tcache.find(def_id) {
424425
some(tpt) { ret tpt; }
425426
_ {}
426427
}
427-
let def_id = {crate: ast::local_crate, node: it.id};
428428
alt it.node {
429429
ast::item_const(t, _) {
430430
let typ = ast_ty_to_ty(tcx, mode, t);
@@ -917,9 +917,10 @@ mod collect {
917917
}
918918
ast::item_res(decl, tps, _, dtor_id, ctor_id) {
919919
let {bounds, params} = mk_ty_params(tcx, tps);
920+
let def_id = local_def(it.id);
920921
let t_arg = ty_of_arg(tcx, m_collect, decl.inputs[0]);
921-
let t_res = ty::mk_res(tcx, local_def(it.id), t_arg.ty,
922-
params);
922+
let t_res = ty::mk_res(tcx, def_id, t_arg.ty, params);
923+
let t_res = ty::mk_with_id(tcx, t_res, def_id);
923924
let t_ctor = ty::mk_fn(tcx, {
924925
proto: ast::proto_box,
925926
inputs: [{mode: ast::expl(ast::by_copy) with t_arg}],
@@ -934,7 +935,8 @@ mod collect {
934935
write_ty(tcx, it.id, t_res);
935936
write_ty(tcx, ctor_id, t_ctor);
936937
tcx.tcache.insert(local_def(ctor_id),
937-
{bounds: bounds, ty: t_ctor});
938+
{bounds: bounds, ty: t_ctor});
939+
tcx.tcache.insert(def_id, {bounds: bounds, ty: t_res});
938940
write_ty(tcx, dtor_id, t_dtor);
939941
}
940942
ast::item_iface(_, ms) {

0 commit comments

Comments
 (0)