Skip to content

rewrite never type documentation#158370

Draft
WaffleLapkin wants to merge 2 commits into
rust-lang:mainfrom
WaffleLapkin:never-scratch-docs
Draft

rewrite never type documentation#158370
WaffleLapkin wants to merge 2 commits into
rust-lang:mainfrom
WaffleLapkin:never-scratch-docs

Conversation

@WaffleLapkin

@WaffleLapkin WaffleLapkin commented Jun 24, 2026

Copy link
Copy Markdown
Member

With the never type stabilization approaching, I think the documentation could be improved a lot over the status quo ^^'

I intend to merge this after #155499. Split it off into a separate PR for ease of reviewing.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 24, 2026
@WaffleLapkin WaffleLapkin added the F-never_type `#![feature(never_type)]` label Jun 24, 2026
@WaffleLapkin WaffleLapkin added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 24, 2026

@kpreid kpreid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw some typos, so here’s a batch of copyediting suggestions (also some for jargon clarification). Feel free to ignore these if not useful.

View changes since this review

Comment thread library/core/src/primitive_docs.rs Outdated
Comment thread library/core/src/primitive_docs.rs Outdated
Comment thread library/core/src/primitive_docs.rs Outdated
/// // `x` has type `u32`
/// Some(x) => x,
/// // `return` has type `!`, which is then coerced to `u32`,
/// // allowing the `match` to typecheck

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// // allowing the `match` to typecheck
/// // allowing the `match` to pass type checking.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I prefer "to typecheck", do you think this is too jargony?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehhhh vague hand gestures only kind of. As a general matter of how I see people failing to understanding things, I think that programming jargon often has what I call a “noun pileup” problem: squeezing all the meaning into a single noun phrase (or verb, in this case) that lacks any structure to indicate what its parts are referring to if you don’t already know. This suggestion was an attempt, not to fix a definite problem, but to improve the average.

In particular, it add an indication (“pass”) that “type checking” is something done to the match, whereas “typecheck” as a verb whose subject is match could point towards more incorrect theories such as “the match is (at run time) checking that the type of the arm matches the type that is needed”. Does that disagree with how Rust works in general? Yes. But the people who need this documentation won’t necessarily know that, so adding more clues towards the right reading helps learning go more smoothly.

But, just like I said for the rest of these, feel free to disregard this suggestion. It’s a guess at what will be more clear.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I can throw my two cents in, I think "pass type checking" reads smoother, something about "...allowing the match to typecheck." just feels clunky.

Comment thread library/core/src/primitive_docs.rs Outdated
Comment thread library/core/src/primitive_docs.rs Outdated
@traviscross traviscross self-assigned this Jun 25, 2026
@traviscross traviscross added T-lang Relevant to the language team T-lang-docs Relevant to the lang-docs team. labels Jun 25, 2026
Co-authored-by: Kevin Reid <kpreid@switchb.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-never_type `#![feature(never_type)]` S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-lang Relevant to the language team T-lang-docs Relevant to the lang-docs team. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants