Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: hide inherent impls with private impl items #137596

Open
lcnr opened this issue Feb 25, 2025 · 0 comments
Open

rustdoc: hide inherent impls with private impl items #137596

lcnr opened this issue Feb 25, 2025 · 0 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@lcnr
Copy link
Contributor

lcnr commented Feb 25, 2025

cc #137576. Rustdoc currently shows inherent impl items even if all impl items are private. This affects BTreeMap:

/// Internal functionality for `BTreeSet`.
impl<K, A: Allocator + Clone> BTreeMap<K, SetValZST, A> {
pub(super) fn replace(&mut self, key: K) -> Option<K>
where
K: Ord,
{
let (map, dormant_map) = DormantMutRef::new(self);
let root_node =
map.root.get_or_insert_with(|| Root::new((*map.alloc).clone())).borrow_mut();
match root_node.search_tree::<K>(&key) {
Found(mut kv) => Some(mem::replace(kv.key_mut(), key)),
GoDown(handle) => {
VacantEntry {
key,
handle: Some(handle),
dormant_map,
alloc: (*map.alloc).clone(),
_marker: PhantomData,
}
.insert(SetValZST);
None
}
}
}

Image of https://doc.rust-lang.org/nightly/std/collections/struct.BTreeMap.html#impl-BTreeMap%3CK,+SetValZST,+A%3E

I feel like the proper fix for this issue is for rustdoc to not show internal inherent impls even if the impl has a doc comment.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 25, 2025
@lcnr lcnr added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 25, 2025
@fmease fmease added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Feb 25, 2025
@rustbot rustbot added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Feb 25, 2025
@fmease fmease removed A-rustdoc-ui Area: Rustdoc UI (generated HTML) needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants