2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unused_imports)]
|
2018-08-31 15:02:01 +02:00
|
|
|
#![allow(non_shorthand_field_patterns)]
|
|
|
|
|
2014-07-04 16:45:47 -07:00
|
|
|
// aux-build:xcrate_struct_aliases.rs
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2014-07-04 16:45:47 -07:00
|
|
|
extern crate xcrate_struct_aliases;
|
|
|
|
|
|
|
|
use xcrate_struct_aliases::{S, S2};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let s = S2 {
|
|
|
|
x: 1,
|
|
|
|
y: 2,
|
|
|
|
};
|
|
|
|
match s {
|
|
|
|
S2 {
|
|
|
|
x: x,
|
|
|
|
y: y
|
|
|
|
} => {
|
|
|
|
assert_eq!(x, 1);
|
|
|
|
assert_eq!(y, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|