mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
16 lines
193 B
Rust
16 lines
193 B
Rust
// edition:2021
|
|
// check-pass
|
|
|
|
#![feature(try_blocks)]
|
|
|
|
|
|
fn main() {
|
|
let _: Result<i32, i32> = try {
|
|
let Some(x) = Some(0) else {
|
|
Err(1)?
|
|
};
|
|
|
|
x
|
|
};
|
|
}
|