Skip to content

RFC: Statically enforce that only one type of doc comment is present on any given item #6781

Closed
@bstrie

Description

@bstrie

This is an abomination, yet totally legal:

/**
 * foo
 */

/// bar

#[doc="spam"]
mod m {
  #[doc="eggs"];

  //! baz

  /*! qux */
}

fn main() {}

Putting aside the fact that we just have waay too many forms of doc comments, this should be a compile-time error. I can think of no scenario where you'd want to split an item's documentation up among several comments, let alone several different types of comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions