Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot call a unboxed-closure trait object with () syntax #16929

Closed
huonw opened this issue Sep 2, 2014 · 4 comments
Closed

Cannot call a unboxed-closure trait object with () syntax #16929

huonw opened this issue Sep 2, 2014 · 4 comments
Labels
A-closures Area: Closures (`|…| { … }`)

Comments

@huonw
Copy link
Member

huonw commented Sep 2, 2014

#![feature(unboxed_closures)]


fn main() {
    let f: &Fn<(), ()> = &|&:| ();

    f()
}
<anon>:7:5: 7:8 error: expected function, found `&core::ops::Fn<(),()>`
<anon>:7     f()
             ^~~
@nixpulvis
Copy link

Wouldn't this need feature(overloaded_calls) anyway?

@arthurprs
Copy link
Contributor

Sub. Stumbled across this in my code today.

@alexcrichton
Copy link
Member

Nominating, I think this may actually be the only remaining major blocker for old closures to be removed from the language.

@ftxqxd
Copy link
Contributor

ftxqxd commented Dec 25, 2014

I think that #19187 would fix this.

bors added a commit to rust-lang-ci/rust that referenced this issue Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: Closures (`|…| { … }`)
Projects
None yet
Development

No branches or pull requests

5 participants