Skip to content

Commit e56a6e8

Browse files
committed
Revert "Forbid classes with no fields" due to test failures
This reverts commit 8fd9986.
1 parent c6e16c5 commit e56a6e8

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

src/rustc/middle/typeck/check.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,6 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
387387
};
388388
// typecheck the members
389389
for members.each {|m| check_class_member(class_ccx, class_t, m); }
390-
// Check that there's at least one field
391-
let (fields,_) = split_class_items(members);
392-
if fields.len() < 1u {
393-
ccx.tcx.sess.span_err(it.span, "A class must have at least one \
394-
field");
395-
}
396390
// Check that the class is instantiable
397391
check_instantiable(ccx.tcx, it.span, it.id);
398392
}

src/test/compile-fail/issue-2509-a.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)