Skip to content

cargo test breaking with forbid(missing_docs) #130218

Closed
@y86-dev

Description

@y86-dev

I tried this code:

//! Provides a noop.

#![forbid(missing_docs)]

/// Does nothing
pub fn noop() {}

in lib.rs.

I expected to see this happen: successful cargo test invocation.

Instead, this happened: cargo test errors:

$ cargo test
   Compiling rust v0.0.0 (/tmp/noop)
error[E0453]: allow(missing_docs) incompatible with previous forbid

For more information about this error, try `rustc --explain E0453`.
error: could not compile `rust` (lib test) due to 1 previous error

Meta

This was triggered today in my daily testing pipeline using nightly. cargo check reports no issues.

rustc --version --verbose:

rustc 1.83.0-nightly (0ee7cb5e3 2024-09-10)
binary: rustc
commit-hash: 0ee7cb5e3633502d9a90a85c3c367eccd59a0aba
commit-date: 2024-09-10
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libtestArea: `#[test]` / the `test` libraryA-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