2017-02-23 15:31:21 -06:00
|
|
|
// Ensure that capturing closures are never coerced to fns
|
|
|
|
// Especially interesting as non-capturing closures can be.
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let b = 0u8;
|
2017-05-08 16:04:49 -05:00
|
|
|
let baz: fn() -> u8 = (|| { b }) as fn() -> u8;
|
2017-06-09 15:04:29 -05:00
|
|
|
//~^ ERROR non-primitive cast
|
2017-02-23 15:31:21 -06:00
|
|
|
}
|