mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
16 lines
293 B
Rust
16 lines
293 B
Rust
fn closure_to_loc() {
|
|
let mut x = |c| c + 1;
|
|
x = |c| c + 1;
|
|
//~^ ERROR mismatched types
|
|
}
|
|
|
|
fn closure_from_match() {
|
|
let x = match 1usize {
|
|
1 => |c| c + 1,
|
|
2 => |c| c - 1,
|
|
_ => |c| c - 1
|
|
};
|
|
//~^^^^ ERROR type annotations needed
|
|
}
|
|
|
|
fn main() { }
|