rust/tests/ui/did_you_mean/casting-fn-item-to-fn-point...

10 lines
238 B
Rust

//@ edition: 2021
fn foo() {}
fn main() {
let _: Vec<(&str, fn())> = [("foo", foo)].into_iter().collect(); //~ ERROR
let _: Vec<fn()> = [foo].into_iter().collect(); //~ ERROR
let _: Vec<fn()> = Vec::from([foo]); //~ ERROR
}