]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/print/closure-print-verbose.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[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 }