]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
0bf4aa26 XL |
2 | #![allow(dead_code)] |
3 | #![allow(unused_assignments)] | |
c34b1796 AL |
4 | // pretty-expanded FIXME #23616 |
5 | ||
5bcae85e | 6 | #![allow(unused_variables)] |
1a4d82fc | 7 | |
223e47cc | 8 | enum Animal { |
1a4d82fc JJ |
9 | Dog (String, f64), |
10 | Cat { name: String, weight: f64 } | |
223e47cc LB |
11 | } |
12 | ||
13 | pub fn main() { | |
1a4d82fc JJ |
14 | let mut a: Animal = Animal::Dog("Cocoa".to_string(), 37.2); |
15 | a = Animal::Cat{ name: "Spotty".to_string(), weight: 2.7 }; | |
223e47cc | 16 | // permuting the fields should work too |
1a4d82fc | 17 | let _c = Animal::Cat { weight: 3.1, name: "Spreckles".to_string() }; |
223e47cc | 18 | } |