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

core::panic documentation is useless #61327

Closed
jplatte opened this issue May 29, 2019 · 5 comments
Closed

core::panic documentation is useless #61327

jplatte opened this issue May 29, 2019 · 5 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@jplatte
Copy link
Contributor

jplatte commented May 29, 2019

For some reason, the documentation for core::panic does not contain any of the useful pieces of information of std::panic's documentation and instead references a non-existent module std::macros.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels May 29, 2019
@Centril Centril added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label May 30, 2019
@czipperz
Copy link
Contributor

czipperz commented Jun 4, 2019

So it turns out the panic macro is defined in both libcore and libstd. Both have documentation. They are defined differently. Presumably libstd is the "better" implementation while libcore is the fallback when nostd is enabled.

I'm considering opening a PR that copies the documentation. Thoughts?

@czipperz
Copy link
Contributor

czipperz commented Jun 4, 2019

I believe the documentation points the the other one because it doesn't want duplication of comments. Which is bad. But it might be better for std to point to core rather than the other way around. Or something like that.

@jplatte
Copy link
Contributor Author

jplatte commented Jun 4, 2019

To avoid duplicating the text while still having the same doc comment for both macros, one could use the external_doc feature: https://doc.rust-lang.org/nightly/unstable-book/language-features/external-doc.html

@czipperz
Copy link
Contributor

czipperz commented Jun 4, 2019

AFAIK there isn't a usual place to put these sorts of markdown files. Where would you recommend? We could move libcore/macros.rs to libcore/macros/mod.rs and then store all the markdown files in there?

@jplatte
Copy link
Contributor Author

jplatte commented Nov 18, 2019

Fixed by #66395

@jplatte jplatte closed this as completed Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants