2018-08-25 23:02:24 -05:00
|
|
|
// rustfmt-edition: Edition2018
|
|
|
|
#![feature(try_blocks)]
|
2017-05-12 17:28:48 -05:00
|
|
|
|
|
|
|
fn main() {
|
2018-08-25 23:02:24 -05:00
|
|
|
let x = try { foo()? };
|
2017-05-12 17:28:48 -05:00
|
|
|
|
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 { unsafe { foo()? } };
|
2017-05-12 17:28:48 -05:00
|
|
|
|
2018-08-25 23:02:24 -05:00
|
|
|
let y = match (try { foo()? }) {
|
2017-05-12 17:28:48 -05:00
|
|
|
_ => (),
|
|
|
|
};
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|