-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
A-cargoArea: Determining directories based on `cargo metadata`Area: Determining directories based on `cargo metadata`C-bugCategory: This is a bugCategory: This is a bugS-blockedStatus: Blocked on another projectStatus: Blocked on another project
Description
Currently doc = false
in a package's manifest is not respected when determining whether a target's docs should be checked:
Lines 133 to 150 in fd46075
fn has_docs(target: &cargo_metadata::Target) -> bool { | |
// Ignore tests, examples, and benchmarks, but still document binaries | |
// See https://doc.rust-lang.org/cargo/reference/external-tools.html#compiler-messages | |
// and https://github.com/rust-lang/docs.rs/issues/503#issuecomment-562797599 | |
// for the difference between `kind` and `crate_type` | |
let mut kinds = target.kind.iter(); | |
// By default, ignore binaries | |
if target.crate_types.contains(&"bin".into()) { | |
// But allow them if this is a literal bin, and not a test or example | |
kinds.all(|kind| kind == "bin") | |
} else { | |
// We also have to consider examples and tests that are libraries | |
// (e.g. because of `cdylib`). | |
kinds.all(|kind| !["example", "test", "bench"].contains(&kind.as_str())) | |
} | |
} |
Furthermore, cargo metadata
does not seem to report the value of the doc
setting for targets, so this is probably an upstream bug to cargo folks first.
jyn514
Metadata
Metadata
Assignees
Labels
A-cargoArea: Determining directories based on `cargo metadata`Area: Determining directories based on `cargo metadata`C-bugCategory: This is a bugCategory: This is a bugS-blockedStatus: Blocked on another projectStatus: Blocked on another project