2015-03-25 10:53:28 -06:00
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn bar(&self) {}
|
|
|
|
}
|
|
|
|
|
2015-04-24 22:58:40 -06:00
|
|
|
trait MyTrait {
|
2015-03-25 10:53:28 -06:00
|
|
|
fn trait_bar() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for Foo {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match 0u32 {
|
2016-10-27 05:17:42 +03: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 10:53:28 -06:00
|
|
|
}
|
|
|
|
match 0u32 {
|
2016-10-27 05:17:42 +03: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 10:53:28 -06:00
|
|
|
}
|
|
|
|
match 0u32 {
|
2016-06-11 18:47:47 +03: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 10:53:28 -06:00
|
|
|
}
|
2019-09-24 14:01:31 +02: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 14:01:31 +02: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 14:01:31 +02: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 10:53:28 -06:00
|
|
|
}
|