2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(unused_variables)]
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
struct A { foo: isize }
|
|
|
|
struct B { a: isize, b: isize, c: isize }
|
2013-12-19 17:21:05 +00:00
|
|
|
|
2014-10-09 19:17:22 +00:00
|
|
|
fn mka() -> A { panic!() }
|
|
|
|
fn mkb() -> B { panic!() }
|
2013-12-19 17:21:05 +00:00
|
|
|
|
|
|
|
fn test() {
|
|
|
|
let A { foo, } = mka();
|
|
|
|
let A {
|
|
|
|
foo,
|
|
|
|
} = mka();
|
|
|
|
|
|
|
|
let B { a, b, c, } = mkb();
|
|
|
|
|
|
|
|
match mka() {
|
|
|
|
A { foo: _foo, } => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
match Some(mka()) {
|
|
|
|
Some(A { foo: _foo, }) => {}
|
|
|
|
None => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
if false { test() }
|
|
|
|
}
|