rust/src/test/run-pass/struct-new-as-field-name.rs
Do Nhat Minh 4457d2b379 fix for #8088 (Cannot name a struct field new due to ancient syntax)
remove code for parsing ancient syntax
added a run-pass test
2013-08-18 00:07:14 +08:00

9 lines
105 B
Rust

struct Foo {
new: int,
}
pub fn main() {
let foo = Foo{ new: 3 };
assert_eq!(foo.new, 3);
}