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

Implementors column on trait page is always empty #91118

Open
aDotInTheVoid opened this issue Nov 22, 2021 · 3 comments
Open

Implementors column on trait page is always empty #91118

aDotInTheVoid opened this issue Nov 22, 2021 · 3 comments
Assignees
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@aDotInTheVoid
Copy link
Member

aDotInTheVoid commented Nov 22, 2021

buf.push_str("<h3 class=\"sidebar-title\"><a href=\"#implementors\">Implementors</a></h3>");

This leads to

image

when the Implementors column is empty

This is finiky to implement, cant just find the html id's for a given item cannot be determined from that item, due to the derive_id makeing the id dependent on cx state.

let id = cx.derive_id(match i.inner_impl().trait_ {
Some(ref t) => {
if is_on_foreign_type {
get_id_for_impl_on_foreign_type(&i.inner_impl().for_, t, cx)
} else {
format!("impl-{}", small_url_encode(format!("{:#}", t.print(cx))))
}
}
None => "impl".to_string(),
});

A way around this would be to add a HashMap<DefId, String> to Context, but I'm not sure if this is the best way arround this, and would apprecieate other ideas.

@rustbot claim

@rustbot modify labels: +A-rustdoc-ui +T-rustdoc

@rustbot rustbot added A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 22, 2021
@aDotInTheVoid
Copy link
Member Author

image

aDotInTheVoid@e3429d7 works in simple case

@camelid
Copy link
Member

camelid commented Nov 28, 2021

I kind of wonder if we should just remove the implementors (and implementations on foreign types) sidebar sections. They're not part of the trait's interface, and for many traits the list will be very long and fill up the sidebar. I will start a discussion on Zulip about this (EDIT: here).

@camelid
Copy link
Member

camelid commented Nov 28, 2021

It may not even be a bug that the section is empty; perhaps it's intended just to be a link to the beginning of the implementors section in the main body of the page. I agree that it looks confusing though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants