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:
commit
02a58a9bee
24 changed files with 284 additions and 62 deletions
6
tests/pretty/try-blocks.rs
Normal file
6
tests/pretty/try-blocks.rs
Normal 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 }; }
|
||||
Loading…
Add table
Add a link
Reference in a new issue