question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

never type stabilization

See original GitHub issue

Summary

Long term goal is to stabilize the ! type and in particular to alter fallback for “diverging type variables” to use ! and not ().

Current status

Working towards a lint that catches the problems associated with changing fallback (https://github.com/rust-lang/rust/issues/66173). Have a draft PR https://github.com/rust-lang/rust/pull/74535 that is being developed by @blitzerr.

Info

What is this issue?

This issue represents an active project group. It is meant to be used for the group to post updates to the lang team (and others) in a lightweight fashion. Please do not use the comments here for discussion, that should be kept in the Zulip stream (discussion comments here will be marked as off-topic).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

18reactions
nikomatsakiscommented, Apr 7, 2021

Status update 2021-04-06:

  • @Mark-Simulacrum wrote up a detailed and useful report after doing some investigation. He and I also discussed the results and came to a preliminary consensus on the path forward.
  • The upshot was:
    • We can’t really leverage editions to avoid breakage so long as we want to update Infallible to !.
    • We can extend the hybrid proposal for never type fallback to cover cases where trait selection would cause further errors. This should allow us to land the never type fallback change without significant breakage.
    • The problem then is that the fallback proposal is kind of complex and still accepts code we arguably should not. We can deprecate that over time using warnings.
    • Once we’ve come to an algorithm or subset of fallback we are happy with, we can use an edition if desired to make a harder change.
17reactions
Mark-Simulacrumcommented, Nov 2, 2021

The initial set of patches landed on master in September. For October, the plan is to:

It’s a little unlikely, but the hope is that we will also get a chance to:

  • Prepare a blog post – though likely not for immediate publication – with the content from the community explainer, with a goal of getting feedback on our design.
  • Start work on a “N year plan” for the future of the inference rules around ! (and perhaps more generally). Niko and I agreed that the current proposal for ! is not ideal, and we’d like to see something simpler – and perhaps more easily understandable/implementable under different schemes than currently in the compiler.

I also discussed with @nikomatsakis whether an RFC makes sense as something to aim towards. We noted that the vast majority of changes related to never type that we’ve been iterating on are likely a little better suited to initiative and/or more internal discussion, since they’re mostly just implementation details of the larger goal laid out in the RFC. We’ve already accepted RFC 1216 for the motivation and general shape of the feature, so that part is largely taken care of. It’s also true that such an RFC – or indeed any documentation in this area – quickly is confronted with the relative lack of documentation for type inference as a whole as implemented in Rust today, so it’s hard to describe ! inference as an “edit”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Never type - The Rust Reference
The never type was expected to be stabilized in 1.41, but due to some last minute regressions detected the stabilization was temporarily reverted....
Read more >
Welcome - Never Type initiative - GitHub Pages
This page tracks the work of the never type initiative! To learn more about what we are ... Feature complete,, Stabilization report. Stabilized, ......
Read more >
`never` crate - stable alternative to ! : r/rust - Reddit
Since never-type is feature-gated, it is considered to be unstable, so such breaking changes are allowed and will be made before stabilization.
Read more >
Never-type fallback - HackMD
The stabilization of the ! ('never') type was recently attempted in ; Rust allows the creation of 'empty enums' with no variants (e.g....
Read more >
Never - Rust Community Wiki
The never type, also called uninhabited type, indicated with an ... When the never_type feature is stabilized, it will be possible to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found