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

Coercions section: some coercions are missing #237

Closed
1 of 2 tasks
mexus opened this issue Sep 27, 2020 · 5 comments · Fixed by rust-lang/reference#1079
Closed
1 of 2 tasks

Coercions section: some coercions are missing #237

mexus opened this issue Sep 27, 2020 · 5 comments · Fixed by rust-lang/reference#1079

Comments

@mexus
Copy link
Contributor

mexus commented Sep 27, 2020

Currently, the Coercions (src/coercions.md) section doesn't mention the accepted and implemented (and stabilized) RFC Allow coercing non-capturing closures to function pointers.

Could it be that more coercions have been forgotten? :) I can't think of any right now, but I could have also forgotten something xD

TODO

@MikailBag
Copy link

Also coercion from unnameable-function-type to fn pointer is not covered.

@mexus
Copy link
Contributor Author

mexus commented Sep 27, 2020

@MikailBag could you pls provide an example? I don't quite get what exactly the coercion is about..

@MikailBag
Copy link

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=aefe8a9bcde0b9ebac8afac2d10be87d

This code shows that foo and bar have different types

@mexus
Copy link
Contributor Author

mexus commented Sep 27, 2020

Got it! But what about "unnameable function types"?

Ok now I got it for real :) Yeah, I guess it is worth mentioning that "function items" are implicitly coercible to function pointers, as RFC 0401 states.

@JohnTitor JohnTitor added the C-enhancement Needs additonal contents. label Nov 1, 2020
@JohnTitor JohnTitor changed the title Coercions section: come coercions are missing Coercions section: some coercions are missing Nov 5, 2020
@JohnTitor
Copy link
Member

This could go to the reference as per #230 (comment).

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

Successfully merging a pull request may close this issue.

3 participants