Plan regarding the special-casing of diverging blocks #125936
Labels
C-discussion
Category: Discussion or questions that doesn't represent real issues.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
We had FCPed a decision to adopt a particular Option 2 with respect to the handling of diverging blocks:
return
,break
, orcontinue
are used syntactically and no dead code (that doesn't itself diverge) follows. Do this after macro expansion at the time of type checking (so that, e.g.let _: ! = { panic!(); }
also works).However, we later realized that part of this couldn't work.
However, before we could discuss that, the PR was closed as the author no longer believes in this approach.
The general feeling of the lang team, in our recent discussions, had been agreement that, if we could do it over again, we would not adopt this special-casing. People in particular wanted to see diffs like this happen:
Where people had uncertainty was whether and how to adopt the churn for cases like this:
We didn't want to take this churn in Rust 2024, especially given that prior to a recent PR to
rustfmt
, that tool has been adding these semicolons.This issue is about what to do next. Do we want to address this? If so, what steps might we want to take now to better prepare us to take other steps later?
Tracking for Rust 2024:
The text was updated successfully, but these errors were encountered: