Files
rust/tests/ui/did_you_mean/casting-fn-item-to-fn-pointer.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
238 B
Rust
Raw Normal View History

//@ 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
}