diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-07-24 15:29:14 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-07-24 15:29:51 -0700 |
| commit | 587b0edbbf6c3ac587be98679c4262049aa2a305 (patch) | |
| tree | 879bb3bdc266ecc210929950e781c4e9c2d07803 /src/libsyntax/parse | |
| parent | 695ab098995d23b0fa62248b5ce3052e5e072269 (diff) | |
| download | rust-587b0edbbf6c3ac587be98679c4262049aa2a305.tar.gz rust-587b0edbbf6c3ac587be98679c4262049aa2a305.zip | |
rustc: Don't require that structs have constructors
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b9fb9dab374..0686bad2532 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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) } } } |
