Skip to content

expect messages in standard library should follow our guidance #159751

Description

@fee1-dead

View all comments

It's very likely that this turns into a LLM honeypot issue, but...

#96033 added official guidance on messages for .expect four years ago. Many .expect messages we write were either before the guidance existed or did not know of this guidance.

I like the reasoning on the guidance, and I think we should be consistent. So here's a list of files containing user-facing doc .expect messages that can be fixed (E-easy):

Please do not claim this issue, comment below and claim a subdirectory to work on would make it possible for multiple people to work on :D

What is more interesting is that there are many pre-existing .expect messages in our library code that use the expect message wrongly, e.g. Poll::Ready(self.0.take().expect("Ready polled after completion")) in impl<T> Future for Ready<T>, it would be nice if our messages change to be better (to say something like "Ready should not be polled after completion" instead), but that is more user facing and takes more time to decide IMO:

  • TODO: list out user-facing expect messages

To be clear, this issue is meant for new contributes that want to learn how to work on the codebase manually. Do not work on this issue with LLMs.

Activity

  1. added
    E-easy
    on Jul 23, 2026
  2. added
    C-enhancement
    T-libs-api
    A-docs
    T-libs
    I-libs-api-nominated
    on Jul 23, 2026
  3. added
    needs-triage
    on Jul 23, 2026
  4. ChrisDenton commented on Jul 23, 2026

    @ChrisDenton
    Member

    it would be a theoretical breaking change to change these panic messages

    Panic messages, like debug output, are not covered by our stability guarantee. Anyone depending on precise output should expect to be broken.

  5. removed
    needs-triage
    on Jul 23, 2026
  6. pluiee commented on Jul 23, 2026

    @pluiee
  7. removed
    I-libs-api-nominated
    on Jul 23, 2026
  8. fee1-dead commented on Jul 23, 2026

    @fee1-dead
    MemberAuthor

    @pluiee please specify a smaller scope that you want to make PRs on so that this issue can be worked on by multiple people concurrently :)

  9. 124 remaining items

  10. added 6 commits that reference this issue on Oct 9, 2026
  11. added a commit that references this issue on Oct 9, 2026
  12. kaddujames501-ship-it commented on Oct 22, 2026

    @kaddujames501-ship-it

    Hello @fee1-dead!, would like to work on library/core/src/fmt/mod.rs

  13. kaddujames501-ship-it commented on Oct 22, 2026

    @kaddujames501-ship-it

    I read through and realized library/core/src/fmt/mod.rs is complete! lemme look for another issue. thanks.

  14. added 3 commits that reference this issue on Oct 25, 2026
  15. added a commit that references this issue on Oct 26, 2026
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-docsC-enhancementE-easyT-libs

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions