Skip to content

Commit 14e3fde

Browse files
committed
Check that classes are instantiable
that is, check that there aren't any mutually recursive cycles between classes and other types
1 parent 7978783 commit 14e3fde

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rustc/middle/typeck/check.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
386386
};
387387
// typecheck the members
388388
for members.each {|m| check_class_member(class_ccx, class_t, m); }
389+
// Check that the class is instantiable
390+
check_instantiable(ccx.tcx, it.span, it.id);
389391
}
390392
ast::item_ty(t, tps, rp) {
391393
let tpt_ty = ty::node_id_to_type(ccx.tcx, it.id);

0 commit comments

Comments
 (0)