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

Duplicated modules and functions in solana_sdk docs #26211

Closed
brson opened this issue Jun 24, 2022 · 2 comments · Fixed by #26588
Closed

Duplicated modules and functions in solana_sdk docs #26211

brson opened this issue Jun 24, 2022 · 2 comments · Fixed by #26588

Comments

@brson
Copy link
Contributor

brson commented Jun 24, 2022

Problem

The crate documentation for solana_sdk lists duplicate modules for entrypoint, feature, and many other items. This arises because solana_sdk is glob-reexporting solana_program::* but also redefining several of the items within that crate. Rust callers only see the redefinitions but due to a bug (rust-lang/rust#60522) in rustdoc, the documentation shows two definitions.

Clicking either definition leads to the same page. The linked issue indicates that whether rustdoc shows the reexport or the redefinition is non-deterministic, but so far I have only seen rustdoc show the redefinitions in this case.

Proposed Solution

While fixing the bug upstream would be best, I intend to just add #[doc(hidden)] to the redefinitions to work around the problem.

@brson
Copy link
Contributor Author

brson commented Jun 24, 2022

Some of the redefinitions can probably be eliminated by moving their defs into solana_program.

@brson
Copy link
Contributor Author

brson commented Jun 30, 2022

After looking into this a bit more I think using #[doc(hidden)] here will just make a bigger mess. I am seeing that sometimes rustdoc generates the correct docs, for the duplicated solana_sdk modules, and sometimes the incorrect docs, for the imported solana_program modules. It's pretty confusing. It would be best to try to fix this upstream, and if not, to change the * imports to enumerate every import explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant