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