Skip to content

Private fields in aliased type should not be shown #124938

Closed
@Urgau

Description

@Urgau

I tried this code:

use std::collections::BTreeMap;

pub type FooBar = BTreeMap<u32, String>;

with rustdoc and --document-private-items.

I expected to see this happen: No internal fields of the BTreeMap should be displayed as users won't be able to use the fields, making their appearance confusing and useless.

Instead, this happened: The internal fields of the BTreeMap are displayed

image

Real impact as can be seen here.

Meta

rustdoc --version --verbose:

rustdoc 1.80.0-nightly (7d83a4c13 2024-05-06)
binary: rustdoc
commit-hash: 7d83a4c131ab9ae81a74c6fd825c827d74a2881d
commit-date: 2024-05-06
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.4

Metadata

Metadata

Assignees

Labels

A-rustdoc-uiArea: Rustdoc UI (generated HTML)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