Skip to content

No way to run no_run doctests #82715

Open
@jonhoo

Description

@jonhoo

The Rustdoc book suggests that no_run

[..] is important for examples such as "Here's how to retrieve a web page," which you would want to ensure compiles, but might be run in a test environment that has no network access.

However, it follows from this that in some cases you do want to run doctests marked as no_run, such as if the test environment does have network access. This is possible with regular tests marked #[ignore] by passing -- --ignored to cargo test, but the same does not work with documentation tests. Either an argument to run no_run doctests should be added, or the rustdoc book should be updated with a more appropriate use-case for no_run. The latter is probably a better solution for now, given that adding such a flag would likely be difficult.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: Documentation tests, run by rustdocT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions