rust/tests/ui/issues/issue-28971.rs
2023-01-11 09:32:08 +00:00

17 lines
268 B
Rust

enum Foo {
Bar(u8)
}
fn main(){
foo(|| {
match Foo::Bar(1) {
Foo::Baz(..) => (),
//~^ ERROR no variant or associated item named `Baz` found
_ => (),
}
});
}
fn foo<F>(f: F) where F: FnMut() {
f();
}