Skip to content

rustdoc: --document-private-items does not document non-exported macros #78091

Closed
@camelid

Description

@camelid

With --document-private-items:

  • private fns are documented
  • public fns are documented
  • #[macro_export] macro_rules! are documented
  • non-exported macro_rules! are not documented

I'm not sure if this is intended behavior, but it's not very intuitive and kind of frustrating.

Code

macro_rules! foo_macro {
    () => { };
}

#[macro_export]
macro_rules! exported_foo_macro {
    () => { };
}

fn foo_fn() {}

pub fn pub_foo_fn() {}

Command

cargo doc --document-private-items

Output

image

Version

$ rustdoc -vV
rustdoc 1.47.0 (18bf6b4f0 2020-10-07)
binary: rustdoc
commit-hash: 18bf6b4f01a6feaf7259ba7cdae58031af1b7b39
commit-date: 2020-10-07
host: x86_64-apple-darwin
release: 1.47.0
LLVM version: 11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions