-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-doc-coverageArea: Calculating how much of a crate has documentationArea: Calculating how much of a crate has documentationC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
I tried this code:
// src/lib.rs
//! ```
//! ```
pub mod foo;
pub mod bar;
// src/foo.rs
//! ```
//! ```
/// ```
/// ```
pub struct Foo;
impl Foo {
/// ```
/// ```
pub fn foo() {}
}
// src/bar.rs
//! ```
//! ```
mod inner {
/// ```
/// ```
pub struct Bar;
impl Bar {
pub fn bar() {}
}
}
pub use inner::Bar;
> cargo rustdoc -- --show-coverage -Zunstable-options
I expected to see this happen:
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| src/bar.rs | 2 | 66.7% | 2 | 66.7% |
| src/foo.rs | 3 | 100.0% | 3 | 100.0% |
| src/lib.rs | 1 | 100.0% | 1 | 100.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 6 | 100.0% | 6 | 100.0% |
+-------------------------------------+------------+------------+------------+------------+
Instead, this happened:
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| src/bar.rs | 2 | 100.0% | 2 | 100.0% |
| src/foo.rs | 3 | 100.0% | 3 | 100.0% |
| src/lib.rs | 1 | 100.0% | 1 | 100.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 6 | 100.0% | 6 | 100.0% |
+-------------------------------------+------------+------------+------------+------------+
src/bar.rs
is ignoring the undocumented public method.
The same also happens with non-inline modules.
Meta
rustdoc 1.82.0-nightly (64ebd39da 2024-08-03)
binary: rustdoc
commit-hash: 64ebd39da5ec28caa3bd7cbb3f22f5949432fe2b
commit-date: 2024-08-03
host: x86_64-unknown-linux-gnu
release: 1.82.0-nightly
LLVM version: 19.1.0
Metadata
Metadata
Assignees
Labels
A-doc-coverageArea: Calculating how much of a crate has documentationArea: Calculating how much of a crate has documentationC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.