Skip to content

rustdoc: Make sure that items are not constructed multiple times during doc inlining #96309

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

Open
petrochenkov opened this issue Apr 22, 2022 · 1 comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

In #96282 (comment) there was some suspicion that it may happen.

By making sure that items, and Attributes in particular, are not constructed multiple times we may improve rustdoc's performance and uncover some logical bugs.

@petrochenkov petrochenkov added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 22, 2022
@GuillaumeGomez
Copy link
Member

I added a static hashset in clean/types.rs with DefId as key and then this code in Item::from_def_id_and_attrs_and_parts:

if !HASHMAP.lock().unwrap().insert(def_id) {
    eprintln!("+> {:?}", def_id);
}

Well, a LOT of duplicates coming from blanket impls code apparently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants