2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2014-06-21 23:16:31 +02:00
|
|
|
//@ aux-build:struct_variant_xc_aux.rs
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2014-06-21 23:16:31 +02:00
|
|
|
extern crate struct_variant_xc_aux;
|
|
|
|
|
2014-11-25 10:00:46 -08:00
|
|
|
use struct_variant_xc_aux::Enum::{StructVariant, Variant};
|
2014-06-21 23:16:31 +02:00
|
|
|
|
|
|
|
pub fn main() {
|
2014-06-13 19:09:12 -07:00
|
|
|
let arg = match (StructVariant { arg: 42 }) {
|
2014-06-21 23:16:31 +02:00
|
|
|
Variant(_) => unreachable!(),
|
|
|
|
StructVariant { arg } => arg
|
|
|
|
};
|
|
|
|
assert_eq!(arg, 42);
|
|
|
|
}
|