2016-09-14 16:51:46 -05:00
|
|
|
// Can't use unit struct as tuple struct pattern
|
2015-10-02 14:41:24 -05:00
|
|
|
|
2016-01-14 05:26:50 -06:00
|
|
|
// aux-build:empty-struct.rs
|
|
|
|
|
|
|
|
extern crate empty_struct;
|
|
|
|
use empty_struct::*;
|
|
|
|
|
|
|
|
struct Empty2;
|
2015-10-02 14:41:24 -05:00
|
|
|
|
|
|
|
enum E {
|
2016-01-14 05:26:50 -06:00
|
|
|
Empty4
|
2015-10-02 14:41:24 -05:00
|
|
|
}
|
|
|
|
|
2016-02-18 13:30:57 -06:00
|
|
|
fn main() {
|
2016-01-14 05:26:50 -06:00
|
|
|
let e2 = Empty2;
|
|
|
|
let e4 = E::Empty4;
|
|
|
|
let xe2 = XEmpty2;
|
|
|
|
let xe4 = XE::XEmpty4;
|
2015-10-02 14:41:24 -05:00
|
|
|
|
2016-09-14 16:51:46 -05:00
|
|
|
match e2 {
|
2019-10-14 19:20:50 -05:00
|
|
|
Empty2() => () //~ ERROR expected tuple struct or tuple variant, found unit struct `Empty2`
|
2016-09-14 16:51:46 -05:00
|
|
|
}
|
|
|
|
match xe2 {
|
2019-10-14 19:20:50 -05:00
|
|
|
XEmpty2() => ()
|
|
|
|
//~^ ERROR expected tuple struct or tuple variant, found unit struct `XEmpty2`
|
2016-09-14 16:51:46 -05:00
|
|
|
}
|
2016-01-14 05:26:50 -06:00
|
|
|
match e2 {
|
2019-10-14 19:20:50 -05:00
|
|
|
Empty2(..) => ()
|
|
|
|
//~^ ERROR expected tuple struct or tuple variant, found unit struct `Empty2`
|
2016-01-14 05:26:50 -06:00
|
|
|
}
|
|
|
|
match xe2 {
|
2019-10-14 19:20:50 -05:00
|
|
|
XEmpty2(..) => ()
|
|
|
|
//~^ ERROR expected tuple struct or tuple variant, found unit struct `XEmpty2`
|
2015-10-26 13:09:12 -05:00
|
|
|
}
|
2016-07-29 15:47:55 -05:00
|
|
|
|
2016-09-14 16:51:46 -05:00
|
|
|
match e4 {
|
2019-10-14 19:20:50 -05:00
|
|
|
E::Empty4() => ()
|
|
|
|
//~^ ERROR expected tuple struct or tuple variant, found unit variant `E::Empty4`
|
2016-09-14 16:51:46 -05:00
|
|
|
}
|
|
|
|
match xe4 {
|
|
|
|
XE::XEmpty4() => (),
|
2019-10-14 19:20:50 -05:00
|
|
|
//~^ ERROR expected tuple struct or tuple variant, found unit variant `XE::XEmpty4`
|
2016-09-14 16:51:46 -05:00
|
|
|
_ => {},
|
|
|
|
}
|
2016-01-14 05:26:50 -06:00
|
|
|
match e4 {
|
2019-10-14 19:20:50 -05:00
|
|
|
E::Empty4(..) => ()
|
|
|
|
//~^ ERROR expected tuple struct or tuple variant, found unit variant `E::Empty4`
|
2016-01-14 05:26:50 -06:00
|
|
|
}
|
|
|
|
match xe4 {
|
2016-09-14 16:51:46 -05:00
|
|
|
XE::XEmpty4(..) => (),
|
2019-10-14 19:20:50 -05:00
|
|
|
//~^ ERROR expected tuple struct or tuple variant, found unit variant `XE::XEmpty4`
|
2016-01-14 05:26:50 -06:00
|
|
|
_ => {},
|
2015-10-26 13:09:12 -05:00
|
|
|
}
|
2015-10-02 14:41:24 -05:00
|
|
|
}
|