Code
pub fn foo() {
/// nested fn
pub fn bar() {
}
bar();
}
Current output
Desired output
warning: unused doc comment
--> src/lib.rs:3:3
|
3 | /// nested fn
| ^^^^^^^^^^^^^
4 | pub fn bar() {
| -------------- rustdoc does not generate documentation for items defined in functions
|
= help: use `//` for a plain comment
= note: `#[warn(unused_doc_comments)]` (part of `#[warn(unused)]`) on by default
Rationale and extra context
The bar function doesn't appear in the generated documentation, even when --document-private-items is passed. That's intentional, and #110422 added code and tests to make it happen.
Other cases
Rust Version
% rustc +dev --version --verbose
rustc 1.98.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: aarch64-apple-darwin
release: 1.98.0-dev
LLVM version: 22.1.8
Anything else?
No response
Code
Current output
Desired output
Rationale and extra context
The
barfunction doesn't appear in the generated documentation, even when--document-private-itemsis passed. That's intentional, and #110422 added code and tests to make it happen.Other cases
Rust Version
Anything else?
No response