about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-03-28 06:12:47 -0700
committerbors <bors@rust-lang.org>2013-03-28 06:12:47 -0700
commit09dc38eda54537c0c10b8a89852c714e3e14f57a (patch)
tree77bd2fba611c9a0b7584cb0d2be104c9d4e97913 /src/libsyntax/parse
parentb1c0a6628beb612f3d847ab088e74da639f6ca7b (diff)
parent09255dbe2d7a94cf6a3d8bf426e428f1a50d3e8c (diff)
downloadrust-09dc38eda54537c0c10b8a89852c714e3e14f57a.tar.gz
rust-09dc38eda54537c0c10b8a89852c714e3e14f57a.zip
auto merge of #5596 : luqmana/rust/unit-struct, r=catamorphism
Fixes #5449.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 8d65f02119b..6fe003b2eba 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3207,6 +3207,10 @@ pub impl Parser {
                   }
                 }
             }
+            if fields.len() == 0 {
+                self.fatal(fmt!("Unit-like struct should be written as: struct %s;",
+                                *self.interner.get(class_name)));
+            }
             self.bump();
         } else if *self.token == token::LPAREN {
             // It's a tuple-like struct.