1
Fork 0

rustc: Don't require that structs have constructors

This commit is contained in:
Patrick Walton 2012-07-24 15:29:14 -07:00
parent 695ab09899
commit 587b0edbbf
11 changed files with 165 additions and 109 deletions

View file

@ -2205,20 +2205,22 @@ class parser {
alt the_ctor {
some((ct_d, ct_attrs, ct_b, ct_s)) {
(class_name,
item_class(ty_params, traits, ms, {
item_class(ty_params, traits, ms, some({
node: {id: ctor_id,
attrs: ct_attrs,
self_id: self.get_id(),
dec: ct_d,
body: ct_b},
span: ct_s}, actual_dtor),
span: ct_s}), actual_dtor),
none)
}
/*
Is it strange for the parser to check this?
*/
none {
self.fatal(~"class with no constructor");
(class_name,
item_class(ty_params, traits, ms, none, actual_dtor),
none)
}
}
}