Update for stabilization of the never type#2283
Open
ehuss wants to merge 7 commits into
Open
Conversation
With stabilization of never, this constraint is removed. rust-lang#2186 will handle adding call expression divergence behavior.
This moves type.never.intro to the top of the chapter to match the style where the intro should always come first in a section.
This moves the never example to the intro to match our layout style, and adds an example showing a type expression using `!`.
In the stabilization, the dependency_on_unit_never_type_fallback is being made a hard error in all editions.
Comment on lines
-78
to
-79
| > [!EDITION-2024] | ||
| > Before the 2024 edition, the type was inferred to instead be `()`. |
Member
There was a problem hiding this comment.
A shame that we can't represent "before rust x.y.z with edition < 2024"...
Some of these examples can be simplified with using the never type.
Never can coerce to itself.
This tries to punch up the never type intro by linking to the divergence chapter.
Contributor
Author
|
Thanks @WaffleLapkin! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates for the stabilization of the never type proposed in rust-lang/rust#155499.
cc @WaffleLapkin