]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/const-big-enum.rs
Remove the in-tree `flate` crate
[rust.git] / src / test / run-pass / const-big-enum.rs
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
12 enum Foo {
13     Bar(u32),
14     Baz,
15     Quux(u64, u16)
16 }
17
18 static X: Foo = Foo::Baz;
19
20 pub fn main() {
21     match X {
22         Foo::Baz => {}
23         _ => panic!()
24     }
25     match Y {
26         Foo::Bar(s) => assert_eq!(s, 2654435769),
27         _ => panic!()
28     }
29     match Z {
30         Foo::Quux(d,h) => {
31             assert_eq!(d, 0x123456789abcdef0);
32             assert_eq!(h, 0x1234);
33         }
34         _ => panic!()
35     }
36 }
37
38 static Y: Foo = Foo::Bar(2654435769);
39 static Z: Foo = Foo::Quux(0x123456789abcdef0, 0x1234);