2025-07-24 17:52:22 +05:00
|
|
|
//! Regression test for https://github.com/rust-lang/rust/issues/14308
|
|
|
|
|
|
2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
struct A(isize);
|
2014-05-20 18:20:26 -07:00
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let x = match A(3) {
|
2015-01-25 22:05:03 +01:00
|
|
|
A(..) => 1
|
2014-05-20 18:20:26 -07:00
|
|
|
};
|
|
|
|
|
assert_eq!(x, 1);
|
|
|
|
|
let x = match A(4) {
|
2015-01-25 22:05:03 +01:00
|
|
|
A(1) => 1,
|
|
|
|
|
A(..) => 2
|
2014-05-20 18:20:26 -07:00
|
|
|
};
|
|
|
|
|
assert_eq!(x, 2);
|
|
|
|
|
}
|