]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/closure-no-fn-3.rs
Rollup merge of #106638 - RalfJung:realstd, r=thomcc
[rust.git] / tests / ui / closures / closure-no-fn-3.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 b = 0u8;
6     let baz: fn() -> u8 = (|| { b }) as fn() -> u8;
7     //~^ ERROR non-primitive cast
8 }