Skip to content

Conversation

alexcrichton
Copy link
Collaborator

No description provided.

@sfackler
Copy link
Owner

What was the need for all of the manual casting?

sfackler added a commit that referenced this pull request Dec 23, 2014
@sfackler sfackler merged commit b136cf6 into sfackler:master Dec 23, 2014
@alexcrichton alexcrichton deleted the update branch December 23, 2014 17:08
@alexcrichton
Copy link
Collaborator Author

Introduced in rust-lang/rust#19891, all functions now have anonymous types and they can be cast to a function pointer type. I believe this is to allow the optimization for the type of a function to have 0 size in the future (for unboxed closures primarily I believe).

@sfackler
Copy link
Owner

Interesting. I had assumed that there would be automatic coercion there.

@alexcrichton
Copy link
Collaborator Author

Typically there is, but sadly it doesn't happen through an Option right now. Because each of these was Some(some_function) the expression had the type Option<F> where you can't name F, and manual coercions had to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants