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

Unboxed closure: infer `move` when passing an unboxed closure to Fn* + Send #18799

Closed
carllerche opened this Issue Nov 9, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@carllerche
Copy link
Member

carllerche commented Nov 9, 2014

It would be really amazing if in the following snippet, the "move" was inferred by the fact that the closure is passed as a Fn* + Send. Aka, that move was inferred by the Send trait.

fn stuff<F: FnOnce() + Send>(f: F) {
}

pub fn main() {
    stuff(move |:| println!("hello"));
}

@carllerche carllerche referenced this issue Nov 9, 2014

Closed

Unboxed closure metabug #18101

45 of 47 tasks complete

@huonw huonw added the A-closures label Nov 9, 2014

@huonw

This comment has been minimized.

Copy link
Member

huonw commented Jan 25, 2015

It seems this would be better suited by tying to 'static instead of Send; especially given rust-lang/rfcs#458.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jan 25, 2015

I am not sure whether to implement this inference or not. See thoughts here: http://discuss.rust-lang.org/t/on-the-topic-of-inferring-move-closures/1438

And yes @huonw I've been assuming we would tie it to 'static, not Send.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 5, 2015

Conclusion from the thread was "won't fix".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.