libsyntax: error on struct Foo {}.

This commit is contained in:
Luqman Aden 2013-03-27 18:17:58 -07:00
parent 30b1957cd4
commit 09255dbe2d
4 changed files with 21 additions and 1 deletions

View file

@ -3214,6 +3214,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.