Skip to content

cargo doc --open error message is confusing when all targets are skipped #14776

@profwpollock

Description

@profwpollock

Problem

I use an alias for this command:

$ cargo doc -v --open --workspace --document-private-items --all-features --no-deps --examples

When first developing a new project, there are no examples yet. The output is:

warning: target filter `examples` specified, but no targets matched; this is a no-op
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
error: no crates with documentation

So it is NOT a "no-op". I believe it should be. The warning alone is fine.

Proposed Solution

Instead of failing to provide crate documentation, it should create crate documentation even if there's no examples yet.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-docS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions