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