Skip to content

warning: doc tests are not supported for crate type(s) cdylib even with explicit doctest = false #15964

@sourcefrog

Description

@sourcefrog

With this Cargo.toml

[package]
name = "rustdoc-warning-repro"
version = "0.1.0"
edition = "2024"

[lib]
crate-type = [ "cdylib" ]
doctest = false

Run

; cargo t --doc --workspace
warning: doc tests are not supported for crate type(s) `cdylib` in package `rustdoc-warning-repro`

In the case of an isolated crate I suppose it makes sense to tell you there's nothing to run, but if this is inside a workspace and you're running cargo t --workspace --doc the error message is noise since you've asked for them not to be run.

I realize this is very minor, feel free to close if it seems too trivial. But maybe it's easy to suppress the message if doctest = false?

Meta

rustc --version --verbose:

; rustc --version --verbose
rustc 1.90.0-beta.7 (fb918cec0 2025-08-29)
binary: rustc
commit-hash: fb918cec013920472f6975b2009b0339d9e8cc9c
commit-date: 2025-08-29
host: aarch64-apple-darwin
release: 1.90.0-beta.7
LLVM version: 20.1.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)A-doctestsArea: rustdoc --testA-new-lintArea: new lintC-bugCategory: bugCommand-testS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions