mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
18 lines
298 B
Rust
18 lines
298 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();
|
|
//~^ ERROR: cannot borrow
|
|
}
|