Skip to content

Missing docs lint ineffectual in test builds #24584

Open
@fenhl

Description

@fenhl

The missing_docs lint does not do anything in test builds. Minimal code example:

#![cfg_attr(test, deny(missing_docs))]

To reproduce, make a new crate, replace src/lib.rs with the above code, and run cargo test. The command will run successfully. I would expect the command to report a “missing documentation for crate” compile error.

As for the cause, my wild guess is some sort of interaction between cfg(test) and which items are detected as public.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions