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 #38211

Closed
jrvidal opened this issue Dec 7, 2016 · 3 comments
Closed

Document the types of "static" functions #38211

jrvidal opened this issue Dec 7, 2016 · 3 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools

Comments

@jrvidal
Copy link
Contributor

jrvidal commented Dec 7, 2016

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.

@bluss
Copy link
Member

bluss commented Dec 7, 2016

The lack of Clone is a rather annoying bug (#28229) and does of course makes no sense to keep around (Copy requires that Clone is implemented according to its definition).

@Mark-Simulacrum
Copy link
Member

Tagging with T-doc. cc @rust-lang/docs, maybe this is good for inclusion into the reference? Or the book?

@Mark-Simulacrum Mark-Simulacrum added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label May 16, 2017
@Mark-Simulacrum
Copy link
Member

This should be refiled onto the reference https://github.com/rust-lang-nursery/reference. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools
Projects
None yet
Development

No branches or pull requests

3 participants