You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
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.
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?
Activity
czipperz commentedon 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 commentedon 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 commentedon 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 commentedon 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.rstolibcore/macros/mod.rsand then store all the markdown files in there?jplatte commentedon Nov 18, 2019
Fixed by #66395