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

Experimentally add *heterogeneous* `try` blocks

rust-lang/rust#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/rust#149025 by letting them move to this syntax instead.

New tracking issue: rust-lang/rust#149488
Related RFC: https://github.com/rust-lang/rfcs/pull/3721#issuecomment-3208342727 (specifically about experimenting)
This commit is contained in:
Matthias Krüger 2025-12-10 17:16:47 +01:00 committed by GitHub
commit 02a58a9bee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 284 additions and 62 deletions

View file

@ -0,0 +1,6 @@
//@ pp-exact
//@ edition: 2024
#![feature(try_blocks, try_blocks_heterogeneous)]
fn main() { try { Some(1)? }; try bikeshed Result<u32, ()> { 3 }; }