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