]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/print/closure-print-verbose.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / closures / print / closure-print-verbose.rs
1 // compile-flags: -Zverbose
2
3 // Same as closure-coerce-fn-1.rs
4
5 // Ensure that capturing closures are never coerced to fns
6 // Especially interesting as non-capturing closures can be.
7
8 fn main() {
9     let mut a = 0u8;
10     let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
11     //~^ ERROR mismatched types
12 }