Jed Davis | 30aae3d | 2013-01-31 01:51:57 | [diff] [blame] | 1 | // Copyright 2013 The Rust Project Developers. See the COPYRIGHT |
| 2 | // file at the top-level directory of this distribution and at |
| 3 | // http://rust-lang.org/COPYRIGHT. |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | // option. This file may not be copied, modified, or distributed |
| 9 | // except according to those terms. |
| 10 | |
| 11 | enum E { V16(u16), V32(u32) } |
| 12 | struct S { a: E, b: u16, c: u16 } |
Patrick Walton | 85c9fc6 | 2013-03-22 21:00:15 | [diff] [blame] | 13 | static C: S = S { a: V16(0xDEAD), b: 0x600D, c: 0xBAD }; |
Jed Davis | 30aae3d | 2013-01-31 01:51:57 | [diff] [blame] | 14 | |
Jed Davis | 9939d88 | 2013-02-17 22:36:43 | [diff] [blame] | 15 | pub fn main() { |
Jed Davis | 30aae3d | 2013-01-31 01:51:57 | [diff] [blame] | 16 | let n = C.b; |
Patrick Walton | 1e91595 | 2013-03-29 01:39:09 | [diff] [blame] | 17 | assert!(n != 0xBAD); |
Corey Richardson | cc57ca0 | 2013-05-19 02:02:45 | [diff] [blame] | 18 | assert_eq!(n, 0x600D); |
Jed Davis | 30aae3d | 2013-01-31 01:51:57 | [diff] [blame] | 19 | } |