2013-02-24 14:48:34 -08:00
|
|
|
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2013-10-02 20:00:54 -07:00
|
|
|
#[feature(struct_variant)];
|
|
|
|
|
2013-02-24 14:48:34 -08:00
|
|
|
enum E {
|
|
|
|
S0 { s: ~str },
|
|
|
|
S1 { u: uint }
|
|
|
|
}
|
|
|
|
|
2013-03-22 14:00:15 -07:00
|
|
|
static C: E = S1 { u: 23 };
|
2013-02-24 14:48:34 -08:00
|
|
|
|
2013-03-27 09:58:28 -07:00
|
|
|
pub fn main() {
|
2013-02-24 14:48:34 -08:00
|
|
|
match C {
|
2013-11-28 12:22:53 -08:00
|
|
|
S0 { .. } => fail!(),
|
2013-03-28 18:39:09 -07:00
|
|
|
S1 { u } => assert!(u == 23)
|
2013-02-24 14:48:34 -08:00
|
|
|
}
|
|
|
|
}
|