Open
Description
a/src/lib.rs
pub use b::*;
b/src/lib.rs
/// Documented with example
///
/// ```
/// // The example
/// ```
pub struct B1;
/// Documented, no example
pub struct B2;
// Undocumented
pub struct B3;
In b
b$ cargo +nightly rustdoc -- -Z unstable-options --show-coverage
Documenting b v0.1.0 (/home/gh-aDotInTheVoid/tmp/b)
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| src/lib.rs | 2 | 50.0% | 1 | 25.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 2 | 50.0% | 1 | 25.0% |
+-------------------------------------+------------+------------+------------+------------+
Finished dev [unoptimized + debuginfo] target(s) in 0.32s
But In a
:
a$ cargo +nightly rustdoc -- -Z unstable-options --show-coverage
Documenting a v0.1.0 (/home/gh-aDotInTheVoid/tmp/a)
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| src/lib.rs | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+
Finished dev [unoptimized + debuginfo] target(s) in 0.11s
These outputs should be the same.
When writing tests for this, also add one with --output-format json
, as that flag is overloaded between this and the json backend, and the json backend interacts in funny ways with inlining.
rustdoc 1.70.0-nightly (a41fc00 2023-04-13)
binary: rustdoc
commit-hash: unknown
commit-date: unknown
host: aarch64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.2