Skip to content

[lifetime-elision.function.intro] talks about "closure traits", links to closures #1856

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

Open
lcnr opened this issue Jun 13, 2025 · 2 comments
Labels
A-closures Area: closures Language Cleanup Improvements to existing language which is correct but not clear, or missing examples, or the like.

Comments

@lcnr
Copy link
Contributor

lcnr commented Jun 13, 2025

https://doc.rust-lang.org/stable/reference/lifetime-elision.html#r-lifetime-elision.function.intro

What are closure trait signatures? The FnX traits are called call traits separately https://doc.rust-lang.org/stable/reference/types/closure.html#r-type.closure.call

@ehuss
Copy link
Contributor

ehuss commented Jun 13, 2025

Yes, I believe they are now called "call traits". Looks like that changed in #249. Presumably because those traits can be implemented for things other than closures? Maybe it should also link to https://doc.rust-lang.org/nightly/reference/types/closure.html#call-traits-and-coercions?

@ehuss ehuss added Language Cleanup Improvements to existing language which is correct but not clear, or missing examples, or the like. A-closures Area: closures labels Jun 13, 2025
@lcnr
Copy link
Contributor Author

lcnr commented Jun 13, 2025

Presumably because those traits can be implemented for things other than closures

certainly 😁 function pointers and items also implement FnX. And on nightly, users can manually impl these traits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: closures Language Cleanup Improvements to existing language which is correct but not clear, or missing examples, or the like.
Projects
None yet
Development

No branches or pull requests

2 participants