2015-03-25 16:53:28 +00:00
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn bar(&self) {}
|
|
|
|
}
|
|
|
|
|
2015-04-25 04:58:40 +00:00
|
|
|
trait MyTrait {
|
2015-03-25 16:53:28 +00:00
|
|
|
fn trait_bar() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for Foo {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match 0u32 {
|
2016-10-27 02:17:42 +00:00
|
|
|
Foo::bar => {}
|
2019-10-18 16:05:54 +00:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::bar`
|
2015-03-25 16:53:28 +00:00
|
|
|
}
|
|
|
|
match 0u32 {
|
2016-10-27 02:17:42 +00:00
|
|
|
<Foo>::bar => {}
|
2019-10-18 16:05:54 +00:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::bar`
|
2015-03-25 16:53:28 +00:00
|
|
|
}
|
|
|
|
match 0u32 {
|
2016-06-11 15:47:47 +00:00
|
|
|
<Foo>::trait_bar => {}
|
2019-10-18 16:05:54 +00:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::trait_bar`
|
2015-03-25 16:53:28 +00:00
|
|
|
}
|
2019-09-24 12:01:31 +00:00
|
|
|
if let Foo::bar = 0u32 {}
|
2019-10-18 16:05:54 +00:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::bar`
|
2019-09-24 12:01:31 +00:00
|
|
|
if let <Foo>::bar = 0u32 {}
|
2019-10-18 16:05:54 +00:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::bar`
|
2019-09-24 12:01:31 +00:00
|
|
|
if let Foo::trait_bar = 0u32 {}
|
2019-10-18 16:05:54 +00:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::trait_bar`
|
2015-03-25 16:53:28 +00:00
|
|
|
}
|