Closed
Description
rusti> struct Foo { new: int }
<anon>:2:14: 2:17 error: obsolete syntax: struct constructor
<anon>:2 struct Foo { new: int }
^~~
note: structs are now constructed with `MyStruct { foo: val }` syntax. Structs with private fields cannot be created outside of their defining module
<anon>:2:17: 2:18 error: expected `(` but found `:`
<anon>:2 struct Foo { new: int }
^
rust: task failed at 'explicit failure', /home/huon/rust/src/libsyntax/diagnostic.rs:70
Note that new
is a perfectly legal ident:
rusti> let new: uint = 1; new
1