blob: ae288d7d7a000cc8b83cb37c9900e1d4dc5894cc [file] [log] [blame]
1| |#![allow(unused_assignments)]
2| |// expect-exit-status-1
3| |
4| |fn call(return_error: bool) -> Result<(),()> {
5| 6| if return_error {
6| 1| Err(())
7| | } else {
8| 5| Ok(())
9| | }
10| 6|}
11| |
12| |fn main() -> Result<(),()> {
13| 1| let mut
14| 1| countdown = 10
15| | ;
16| 6| for
17| 6| _
18| | in
19| 1| 0..10
20| | {
21| 6| countdown
22| 6| -= 1
23| | ;
24| | if
25| 6| countdown < 5
26| | {
27| 1| call(/*return_error=*/ true)?;
28| | }
29| | else
30| | {
31| 5| call(/*return_error=*/ false)?;
32| | }
33| | }
34| 0| Ok(())
35| 1|}