]> git.lizzy.rs Git - rust.git/blob - tests/ui/try-block/issue-45124.rs
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / ui / try-block / issue-45124.rs
1 // run-pass
2 #![allow(unreachable_code)]
3 // compile-flags: --edition 2018
4
5 #![feature(try_blocks)]
6
7 fn main() {
8     let mut a = 0;
9     let () = {
10         let _: Result<(), ()> = try {
11             let _ = Err(())?;
12             return
13         };
14         a += 1;
15     };
16     a += 2;
17     assert_eq!(a, 3);
18 }