Skip to content

Clarify in the book when rustdoc tests are run #24228

Closed
@contradictioned

Description

@contradictioned

The new chapter on documentation is great, but in my opinion the documentation tests are still missleading.

When you

  1. create a crate with cargo new --bin mycrate
  2. write a doc test
  3. run cargo test

it will not run this doctest, only if the create was created without the --bin flag. This behaviour is documented in the crates manifest but this should be noted directly in the book. Particularly as I think, most readers of the book will play around with a project with a main.rs but not with a lib.rs.

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