2015-04-04 15:30:23 -05:00
|
|
|
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
|
|
|
|
};
|
2020-05-07 00:12:47 -05:00
|
|
|
//~^^^^ ERROR type annotations needed
|
2015-04-04 15:30:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|