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.
|
|
|
|
|
2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2013-02-24 14:48:34 -08:00
|
|
|
enum E {
|
2014-05-22 16:57:53 -07:00
|
|
|
S0 { s: String },
|
2015-03-25 17:06:52 -07:00
|
|
|
S1 { u: usize }
|
2013-02-24 14:48:34 -08:00
|
|
|
}
|
|
|
|
|
2014-11-06 00:05:53 -08:00
|
|
|
static C: E = 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 {
|
2014-11-06 00:05:53 -08:00
|
|
|
E::S0 { .. } => panic!(),
|
2015-06-07 21:00:38 +03:00
|
|
|
E::S1 { u } => assert_eq!(u, 23)
|
2013-02-24 14:48:34 -08:00
|
|
|
}
|
|
|
|
}
|