2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unreachable_code)]
|
2018-07-21 20:59:44 -07:00
|
|
|
// compile-flags: --edition 2018
|
|
|
|
|
2018-07-24 18:03:25 -07:00
|
|
|
#![feature(try_blocks)]
|
2017-10-15 21:18:08 -07:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut a = 0;
|
|
|
|
let () = {
|
2018-07-21 20:59:44 -07:00
|
|
|
let _: Result<(), ()> = try {
|
2023-06-12 16:55:36 +08:00
|
|
|
let () = Err(())?;
|
2017-10-15 21:18:08 -07:00
|
|
|
return
|
|
|
|
};
|
|
|
|
a += 1;
|
|
|
|
};
|
|
|
|
a += 2;
|
|
|
|
assert_eq!(a, 3);
|
|
|
|
}
|