mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
29 lines
364 B
Rust
29 lines
364 B
Rust
// rustfmt-edition: 2018
|
|
#![feature(try_blocks)]
|
|
|
|
fn main() {
|
|
let x = try {
|
|
foo()?
|
|
};
|
|
|
|
let x = try /* Invisible comment */ { foo()? };
|
|
|
|
let x = try {
|
|
unsafe { foo()? }
|
|
};
|
|
|
|
let y = match (try {
|
|
foo()?
|
|
}) {
|
|
_ => (),
|
|
};
|
|
|
|
try {
|
|
foo()?;
|
|
};
|
|
|
|
try {
|
|
// Regular try block
|
|
};
|
|
}
|