Work around recursive type check for iface types
They are nominal, and can safely refer to themselves.
This commit is contained in:
parent
c13f087454
commit
a62bd9abec
1 changed files with 7 additions and 3 deletions
|
@ -430,9 +430,6 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
|
||||||
@it.ident);
|
@it.ident);
|
||||||
let tpt = {bounds: bounds, ty: t};
|
let tpt = {bounds: bounds, ty: t};
|
||||||
tcx.tcache.insert(local_def(it.id), tpt);
|
tcx.tcache.insert(local_def(it.id), tpt);
|
||||||
ty::store_iface_methods(tcx, it.id, @vec::map(ms, {|m|
|
|
||||||
ty_of_ty_method(tcx, m_collect, m)
|
|
||||||
}));
|
|
||||||
ret tpt;
|
ret tpt;
|
||||||
}
|
}
|
||||||
ast::item_impl(_, _, _, _) | ast::item_mod(_) |
|
ast::item_impl(_, _, _, _) | ast::item_mod(_) |
|
||||||
|
@ -818,6 +815,13 @@ mod collect {
|
||||||
{bounds: bounds, ty: t_ctor});
|
{bounds: bounds, ty: t_ctor});
|
||||||
write::ty_only(cx.tcx, dtor_id, t_dtor);
|
write::ty_only(cx.tcx, dtor_id, t_dtor);
|
||||||
}
|
}
|
||||||
|
ast::item_iface(_, ms) {
|
||||||
|
let tpt = ty_of_item(cx.tcx, m_collect, it);
|
||||||
|
write::ty_only(cx.tcx, it.id, tpt.ty);
|
||||||
|
ty::store_iface_methods(cx.tcx, it.id, @vec::map(ms, {|m|
|
||||||
|
ty_of_ty_method(cx.tcx, m_collect, m)
|
||||||
|
}));
|
||||||
|
}
|
||||||
_ {
|
_ {
|
||||||
// This call populates the type cache with the converted type
|
// This call populates the type cache with the converted type
|
||||||
// of the item in passing. All we have to do here is to write
|
// of the item in passing. All we have to do here is to write
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue