]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/closure-no-fn-1.rs
Rollup merge of #106805 - madsravn:master, r=compiler-errors
[rust.git] / tests / ui / closures / closure-no-fn-1.rs
1 // Ensure that capturing closures are never coerced to fns
2 // Especially interesting as non-capturing closures can be.
3
4 fn main() {
5     let mut a = 0u8;
6     let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
7     //~^ ERROR mismatched types
8 }