2015-03-25 11:53:28 -05:00
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn bar(&self) {}
|
|
|
|
}
|
|
|
|
|
2015-04-24 23:58:40 -05:00
|
|
|
trait MyTrait {
|
2015-03-25 11:53:28 -05:00
|
|
|
fn trait_bar() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for Foo {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match 0u32 {
|
2016-10-26 21:17:42 -05:00
|
|
|
Foo::bar => {}
|
2020-03-04 21:03:15 -06:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found associated function
|
2015-03-25 11:53:28 -05:00
|
|
|
}
|
|
|
|
match 0u32 {
|
2016-10-26 21:17:42 -05:00
|
|
|
<Foo>::bar => {}
|
2020-03-04 21:03:15 -06:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found associated function
|
2015-03-25 11:53:28 -05:00
|
|
|
}
|
|
|
|
match 0u32 {
|
2016-06-11 10:47:47 -05:00
|
|
|
<Foo>::trait_bar => {}
|
2020-03-04 21:03:15 -06:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found associated function
|
2015-03-25 11:53:28 -05:00
|
|
|
}
|
2019-09-24 07:01:31 -05:00
|
|
|
if let Foo::bar = 0u32 {}
|
2020-03-04 21:03:15 -06:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found associated function
|
2019-09-24 07:01:31 -05:00
|
|
|
if let <Foo>::bar = 0u32 {}
|
2020-03-04 21:03:15 -06:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found associated function
|
2019-09-24 07:01:31 -05:00
|
|
|
if let Foo::trait_bar = 0u32 {}
|
2020-03-04 21:03:15 -06:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found associated function
|
2015-03-25 11:53:28 -05:00
|
|
|
}
|