Skip to content

Cannot write doc-tests in markdown files #76709

Closed
@jyn514

Description

@jyn514

Currently, it gives this error:

error[E0585]: found a documentation comment that doesn't document anything
 --> /checkout/src/doc/rustdoc/src/what-to-include.md:68:1
  |
7 | /// ```
  | ^^^^^^^
  |
  = help: doc comments must come before what they document, maybe a comment was intended with `//`?

Rustdoc should always run doctests in markdown, since there's no code to document.

Originally posted by @jyn514 in #75778 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: Documentation tests, run by rustdocA-markdown-parsingArea: Markdown parsing for doc-commentsC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions