2018-08-31 02:04:23 -05:00
|
|
|
// rustfmt-edition: 2018
|
2018-08-25 23:02:24 -05:00
|
|
|
#![feature(try_blocks)]
|
2017-05-12 17:28:48 -05:00
|
|
|
|
|
|
|
fn main() {
|
2018-08-25 23:02:24 -05:00
|
|
|
let x = try {
|
2017-05-12 17:28:48 -05:00
|
|
|
foo()?
|
|
|
|
};
|
|
|
|
|
2018-08-25 23:02:24 -05:00
|
|
|
let x = try /* Invisible comment */ { foo()? };
|
2017-05-12 17:28:48 -05:00
|
|
|
|
2018-08-25 23:02:24 -05:00
|
|
|
let x = try {
|
2017-05-12 17:28:48 -05:00
|
|
|
unsafe { foo()? }
|
|
|
|
};
|
|
|
|
|
2018-08-25 23:02:24 -05:00
|
|
|
let y = match (try {
|
2017-05-12 17:28:48 -05:00
|
|
|
foo()?
|
|
|
|
}) {
|
|
|
|
_ => (),
|
|
|
|
};
|
|
|
|
|
2018-08-25 23:02:24 -05:00
|
|
|
try {
|
2017-05-12 17:28:48 -05:00
|
|
|
foo()?;
|
|
|
|
};
|
|
|
|
|
2018-08-25 23:02:24 -05:00
|
|
|
try {
|
|
|
|
// Regular try block
|
2017-05-12 17:28:48 -05:00
|
|
|
};
|
|
|
|
}
|