rustdoc's --show-coverage flag counts public fields of tuple structs, but this doesn't really make sense, since doc attributes on such fields never appear in the generated documentation.
For example, given the following in src/lib.rs:
//! test
/// test
pub struct Test(pub u8);
cargo rustdoc -- -Z unstable-options --show-coverage reports:
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| src/lib.rs | 2 | 66.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 2 | 66.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+
If src/lib.rs is changed to:
//! test
/// test
pub struct Test(
/// test
pub u8,
);
then the coverage is reported as 100%, but, as expected, the documentation for the pub u8 field isn't included in the documentation generated by cargo doc.
Meta
rustc 1.52.0-nightly (f5d8117c3 2021-03-16)
binary: rustc
commit-hash: f5d8117c338a788bd24abec733fd143dfceb25a0
commit-date: 2021-03-16
host: powerpc64le-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0
rustdoc's
--show-coverageflag counts public fields of tuple structs, but this doesn't really make sense, sincedocattributes on such fields never appear in the generated documentation.For example, given the following in
src/lib.rs:cargo rustdoc -- -Z unstable-options --show-coveragereports:If
src/lib.rsis changed to:then the coverage is reported as 100%, but, as expected, the documentation for the
pub u8field isn't included in the documentation generated bycargo doc.Meta