Implement the alternative `try` block desugaring by scottmcm · Pull Request #148725 · rust-lang/rust

@rustbot rustbot added O-unix

Operating system: Unix-like

S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

Nov 9, 2025

@scottmcm

@scottmcm

petrochenkov

scottmcm

@scottmcm scottmcm added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Nov 13, 2025

@scottmcm

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Nov 14, 2025

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Nov 14, 2025

bors added a commit that referenced this pull request

Nov 14, 2025
Rollup of 4 pull requests

Successful merges:

 - #148638 (Fix ICE for repr simd on non struct)
 - #148725 (Implement the alternative `try` block desugaring)
 - #148777 (Lock shards while emitting depth limit error.)
 - #148933 (Add note for option llvm.download-ci-llvm)

r? `@ghost`
`@rustbot` modify labels: rollup

rust-timer added a commit that referenced this pull request

Nov 14, 2025
Rollup merge of #148725 - scottmcm:experiment-new-try-block-v3, r=petrochenkov

Implement the alternative `try` block desugaring

As discussed in rust-lang/rfcs#3721 (comment), update the `try` in nightly to match the RFC as a way to experiment.

This addresses the following unresolved issue from #31436

>  Address issues with type inference (`try { expr? }?` currently requires an explicit type annotation somewhere).

@scottmcm scottmcm deleted the experiment-new-try-block-v3 branch

November 14, 2025 19:10

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Nov 21, 2025
…pe, r=scottmcm

Constify `residual_into_try_type`

Feature: `const_try_residual` (related to `try_trait_v2_residual`)
Tracking issue: rust-lang#91285

Constify `residual_into_try_type` introduced in rust-lang#148725.

r? `@scottmcm`

Zalathar added a commit to Zalathar/rust that referenced this pull request

Nov 21, 2025
…pe, r=scottmcm

Constify `residual_into_try_type`

Feature: `const_try_residual` (related to `try_trait_v2_residual`)
Tracking issue: rust-lang#91285

Constify `residual_into_try_type` introduced in rust-lang#148725.

r? ``@scottmcm``

rust-timer added a commit that referenced this pull request

Nov 21, 2025
Rollup merge of #149135 - nxsaken:const_residual_into_try_type, r=scottmcm

Constify `residual_into_try_type`

Feature: `const_try_residual` (related to `try_trait_v2_residual`)
Tracking issue: #91285

Constify `residual_into_try_type` introduced in #148725.

r? ``@scottmcm``

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Nov 30, 2025
…v3, r=petrochenkov

Implement the alternative `try` block desugaring

As discussed in rust-lang/rfcs#3721 (comment), update the `try` in nightly to match the RFC as a way to experiment.

This addresses the following unresolved issue from rust-lang#31436

>  Address issues with type inference (`try { expr? }?` currently requires an explicit type annotation somewhere).

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Dec 10, 2025
Experimentally add *heterogeneous* `try` blocks

rust-lang#148725 moved the default to being homogeneous; this adds heterogeneous ones back under an obvious-bikeshed syntax so people can experiment with that as well.

Essentially resolves rust-lang#149025 by letting them move to this syntax instead.

New tracking issue: rust-lang#149488
Related RFC: rust-lang/rfcs#3721 (comment) (specifically about experimenting)

rust-timer added a commit that referenced this pull request

Dec 10, 2025
Rollup merge of #149489 - scottmcm:try-bikeshed, r=nnethercote

Experimentally add *heterogeneous* `try` blocks

#148725 moved the default to being homogeneous; this adds heterogeneous ones back under an obvious-bikeshed syntax so people can experiment with that as well.

Essentially resolves #149025 by letting them move to this syntax instead.

New tracking issue: #149488
Related RFC: rust-lang/rfcs#3721 (comment) (specifically about experimenting)

flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request

Dec 11, 2025

Kobzol pushed a commit to Kobzol/rustc_codegen_cranelift that referenced this pull request

Dec 29, 2025

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Jan 17, 2026
…pe, r=scottmcm

Constify `residual_into_try_type`

Feature: `const_try_residual` (related to `try_trait_v2_residual`)
Tracking issue: rust-lang#91285

Constify `residual_into_try_type` introduced in rust-lang#148725.

r? ``@scottmcm``