This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
Fix duplicate / incorrect docs in solana_sdk by removing the solana_program::* import #26588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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