2.3 Annotations and Documentation

In Rust, there are two types of annotations: normal annotations and documentation annotations. Normal comments use // or /* ... */, and document comments use ///, //! or /** ... **/.

When referring to "comments" in the principles and rules, this includes both normal comments and document comments. When "documentation" is mentioned, it refers specifically to documentation comments.

Reference

  1. RFC 505: API Annotation Conventions
  2. RFC 1574: API Documentation Conventions
  3. Making Great Docs with Rustdoc
  4. Rust Doc book