Skip to content

Tracking issue for cfg(doctest) #62210

Closed
@QuietMisdreavus

Description

@QuietMisdreavus

This feature allows you to restrict items to only be compiled when rustdoc is collecting doctests. This allows you to isolate certain doctests that will be tested, but not shown in documentation - for example, if you need to use compile_fail, or if you're testing the samples in your README file.

We had previously set cfg(test) when collecting doctests, starting in #59940, but this caused issues with libcore that caused all its doctests to be ignored, so that was reverted in #61199. This feature is the replacement for that, currently unstable while we ensure the semantics. The PR where it was posted is #62213.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: Documentation tests, run by rustdocC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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