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

Fix duplicate / incorrect docs in solana_sdk by removing the solana_program::* import #26588

Merged
merged 2 commits into from
Aug 10, 2022

Conversation

brson
Copy link
Contributor

@brson brson commented Jul 12, 2022

Problem

The docs for solana_sdk show many duplicated modules and macros. Per #26211 this is due to a bug in rustdoc (rust-lang/rust#60522) that causes *-imports that are shadowed by local definitions to not be removed from the docs.

This bug not only causes duplicate listings of items, but also non-deterministically causes the docs for those items to show shadowed *-imported version, causing some items defined within those duplicated modules to not be documented at all.

Summary of Changes

This patch removes the solana_program::* import and instead lists every non-shadowed import explicitly.

This is obviously a lot harder to maintain so long as every item in solana_program is intended to be reexported, and made more difficult by some items being target-specific. If this solution is not acceptable I am willing to attempt to make the upstream rustdoc fix, though it will take some time.

Fixes #26211

@mergify mergify bot added the community Community contribution label Jul 12, 2022
@mergify mergify bot requested a review from a team July 12, 2022 17:03
@brson
Copy link
Contributor Author

brson commented Jul 13, 2022

CI failure looks unrelated.

@CriesofCarrots
Copy link
Contributor

The stable-bpf failure does look related, actually

@brson
Copy link
Contributor Author

brson commented Jul 31, 2022

Ah yes it is. I've tried to fix it. I am having trouble running build-bpf locally on the sdk crate, so I'll have to see what the CI says about it.

@CriesofCarrots
Copy link
Contributor

Thanks!

@CriesofCarrots CriesofCarrots merged commit 96a8f19 into solana-labs:master Aug 10, 2022
xiangzhu70 pushed a commit to xiangzhu70/solana that referenced this pull request Aug 17, 2022
…rogram::* import (solana-labs#26588)

* Make solana_sdk imports from solana_program explicit.

* Adjust imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicated modules and functions in solana_sdk docs
2 participants