2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(unused_variables)]
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
struct A { foo: isize }
|
|
|
|
struct B { a: isize, b: isize, c: isize }
|
2013-12-19 11:21:05 -06:00
|
|
|
|
2014-10-09 14:17:22 -05:00
|
|
|
fn mka() -> A { panic!() }
|
|
|
|
fn mkb() -> B { panic!() }
|
2013-12-19 11:21:05 -06: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() }
|
|
|
|
}
|