-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-edition-2024Area: The 2024 editionArea: The 2024 editionF-never_type`#![feature(never_type)]``#![feature(never_type)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-editionRelevant to the edition team.Relevant to the edition team.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
As laid out in the guide for the Never type fallback, closures which panic are now inferred to return !
, rather than ()
.
In Bevy, we encountered this surprising breaking change in the form of bevyengine/bevy#18778. While individual users can work around this by writing |my closure | -> ()
and explicitly specifying a return type or by using an ordinary function, we cannot work around this breakage ourselves by writing another blanket implementation because the Never type (!
) is not available on stable Rust.
Metadata
Metadata
Assignees
Labels
A-edition-2024Area: The 2024 editionArea: The 2024 editionF-never_type`#![feature(never_type)]``#![feature(never_type)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-editionRelevant to the edition team.Relevant to the edition team.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.