stabilize never type - #155499
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2895d33 to
3e8df8d
Compare
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
Footnotes
|
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| fn never_type_behavior(tcx: TyCtxt<'_>) -> (DivergingFallbackBehavior, DivergingBlockBehavior) { | ||
| // FIXME(waffle): rip out the whole system which allows you to choose never type fallback |
There was a problem hiding this comment.
It would be nice to do this immediately after this PR lands, so that this is not forgotten. Rust analyzer seems to have its own copy of this enum, funnily enough.
Can we somehow make sure this is not forgotten?
| // For backwards compatibility reasons, we fall back to | ||
| // `()` until we the diverging default is changed. | ||
| EarlyBinder::bind(tcx, tcx.types.unit) | ||
| EarlyBinder::bind(tcx, tcx.types.never) |
There was a problem hiding this comment.
This change looks right to me, but I feel like I don't have enough type system knowledge to be 100% sure about this change.
I wonder why this wasn't affected by the rustc_never_type_options attribute, was that an accident?
There was a problem hiding this comment.
IIRC this wasn't affected by the attribute on purpose, but I don't remember the details.
This comment has been minimized.
This comment has been minimized.
The reason `rustc_ast_ir` and `rustc_pattern_analysis` have nested `cfg_attr`s is so that they don't mention `cfg(bootstrap)` when nightly or rustc cargo feature turned on. If you don't do it like that, they stop compiling on stable (or rather, they emit unexpected cfg warnings...).
??? why wasn't this detected by compiletest ???
6f4ed82 to
66d5e72
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
66d5e72 to
fc2e81c
Compare

View all comments
This PR
!) (!!!)!on all editions (breaking change, see crater report analysis and refresher on never type fallback)Infalliblean alias to!dependency_on_unit_never_type_fallbacklint (there is no more never type fallback to()so this lint can't be triggered)Cat
Tracking
!to a type (RFC 1216) #35121FCPs
!fall back to!#123508 (comment) (stabilization plan, T-lang)Infallible = !#155924 (comment) (makeInfallible = !, T-libs)Related changes
!fall back to!#123748!fall back to!#123508From<!> for T*reservation* impl #160705Experiments
Infallible = !: [experiment][1] mew #155500Infallible = !, and removing reservation impl: [experiment][2] meow mrrrumph #155501Infallible = !change, without fallback change: [experiment][3] meowww #155657Closes #35121
Closes #148922