Skip to content

core::panic documentation is useless #61327

Closed

Description

@jplatte

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.

Activity

  1. added
    C-bugCategory: This is a bug.
    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
    on May 29, 2019
  2. added
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    on May 30, 2019
  3. czipperz commented on Jun 4, 2019

    @czipperz
    Contributor

    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?

  4. czipperz commented on Jun 4, 2019

    @czipperz
    Contributor

    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.

  5. jplatte commented on Jun 4, 2019

    @jplatte
    ContributorAuthor

    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

  6. czipperz commented on Jun 4, 2019

    @czipperz
    Contributor

    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?

  7. jplatte commented on Nov 18, 2019

    @jplatte
    ContributorAuthor

    Fixed by #66395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions