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

Document the types of "static" functions #72

Closed
Mark-Simulacrum opened this issue Jun 23, 2017 · 1 comment
Closed

Document the types of "static" functions #72

Mark-Simulacrum opened this issue Jun 23, 2017 · 1 comment
Labels
Easy We believe this would not be difficult to actually fix Enhancement Improvement in a non-prose section of the book

Comments

@Mark-Simulacrum
Copy link
Member

refiling rust-lang/rust#38211

There are a few aspects of "static" (non-closure) functions that I find useful to know but I can't seem to locate in the docs:

  • They all implement Copy.
    • And they don't implement Clone (is this unusual?)
  • They automatically implement the respective function call traits Fn, FnMut and FnOnce.
    • And since they don't have an environment... they are equivalent?

I think it might be appropriate to have an entry in the std/core documentation with this. Not sure if a new "primitive" page would be appropriate for it.

@Havvy Havvy added the Enhancement Improvement in a non-prose section of the book label Sep 24, 2017
@Havvy
Copy link
Contributor

Havvy commented Sep 24, 2017

The proper section is function-item-types.

They all do implement Clone now.

@Havvy Havvy added the Easy We believe this would not be difficult to actually fix label Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy We believe this would not be difficult to actually fix Enhancement Improvement in a non-prose section of the book
Projects
None yet
Development

No branches or pull requests

2 participants