auto merge of #8573 : mrordinaire/rust/struct-new-as-field-name, r=alexcrichton

fix for #8088, along with a test.
This commit is contained in:
bors 2013-08-20 21:41:50 -07:00
commit 00dd9e9cc5
4 changed files with 8 additions and 25 deletions

View file

@ -13,8 +13,6 @@ struct s {
//~^ ERROR obsolete syntax: `let` in field declaration
bar: ();
//~^ ERROR obsolete syntax: field declaration terminated with semicolon
new() { }
//~^ ERROR obsolete syntax: struct constructor
}
struct q : r {

View file

@ -0,0 +1,8 @@
struct Foo {
new: int,
}
pub fn main() {
let foo = Foo{ new: 3 };
assert_eq!(foo.new, 3);
}