-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
warn(private_doc_tests) warns about republished items #72081
Copy link
Copy link
Closed
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-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.
Metadata
Metadata
Assignees
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I have doctests on a type in a private module, that's then republished into the crate's top-level module. I think this is a pretty common pattern in Rust?
Here's a simplified example:
If you run rustdoc on this, you'll see
Astruct.If you run rustdoc, it does build and run the test.
I expected there would not be a warning, because the doctest is both visible to users, and run. In other words the warning ought to match whether the item is actually visible.
Also, it seems like a glitch that the warning is reported twice.
Follows on from #55333, #55367, cc @GuillaumeGomez.
Meta
rustc --version --verbose: