Skip to content

expect messages should follow our guidance #159751

Description

@fee1-dead

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions