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

Add docs for keywords #51451

Closed
GuillaumeGomez opened this issue Jun 9, 2018 · 9 comments
Closed

Add docs for keywords #51451

GuillaumeGomez opened this issue Jun 9, 2018 · 9 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools P-medium Medium priority

Comments

@GuillaumeGomez
Copy link
Member

Since the #[doc(keyword = "...")] feature has been merged, we can now add documentation for keywords.

cc @rust-lang/docs

@GuillaumeGomez GuillaumeGomez added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Jun 9, 2018
@QuietMisdreavus
Copy link
Member

QuietMisdreavus commented Jun 14, 2018

Quickly dumping a list of the keywords in the compiler, based on this list. Pretty sure we don't need or want to make a page for all of them, but at least we can start from something. They're broken into sections with their explanatory comment.

"Special reserved identifiers used internally for elided lifetimes,
unnamed method parameters, crate root module, error recovery etc."

  • $crate
  • _

"Keywords used in the language."

"Keywords reserved for future use."

  • abstract
  • become
  • do
  • final
  • macro
  • override
  • priv
  • typeof
  • unsized
  • virtual
  • yield

"Edition-specific keywords reserved for future use."

  • async

"Special lifetime names"

  • '_
  • 'static

"Weak keywords, have special meaning only in specific contexts."

  • auto
  • catch
  • default
  • dyn
  • union

@GuillaumeGomez
Copy link
Member Author

I'll write the docs for one keyword so then we can open it for newcomers.

@inquisitivecrystal
Copy link
Contributor

@iirelu Which of these were you planning on doing?

@iirelu
Copy link
Contributor

iirelu commented Nov 4, 2018

I don't have the free time to write docs any more, so I'm hoping someone else continues where I left off.

@inquisitivecrystal
Copy link
Contributor

Alright, thanks. I may do some then.

@inquisitivecrystal
Copy link
Contributor

I am now working on this.

@steveklabnik steveklabnik added the P-medium Medium priority label Dec 27, 2018
@inquisitivecrystal
Copy link
Contributor

Sorry for the lack of an update. I don’t have time for this at the moment. If I have a chance, I’ll open a PR with what I have although honestly it's mostly additions to the existing ones rather than anything new.

@DevQps
Copy link
Contributor

DevQps commented Apr 2, 2019

Just as an update, some keywords have been fixed:

  • const
  • if
  • enum
  • extern
  • true/false (are referred to the primitive type boolean)
  • as
  • crate

@steveklabnik
Copy link
Member

Closing as a duplicate of #34601, it's older.

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 P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

6 participants