]> git.proxmox.com Git - rustc.git/blob - src/test/run-pass/enum-variants.rs
Imported Upstream version 0.6
[rustc.git] / src / test / run-pass / enum-variants.rs
1 enum Animal {
2 Dog (~str, float),
3 Cat { name: ~str, weight: float }
4 }
5
6 pub fn main() {
7 let mut a: Animal = Dog(~"Cocoa", 37.2);
8 a = Cat{ name: ~"Spotty", weight: 2.7 };
9 // permuting the fields should work too
10 let c = Cat { weight: 3.1, name: ~"Spreckles" };
11 }