]> git.lizzy.rs Git - rust.git/blob - tests/run-make/coverage/simple_loop.rs
Remove confusing 'while checking' note from opaque future type mismatches
[rust.git] / tests / run-make / coverage / simple_loop.rs
1 #![allow(unused_assignments)]
2
3 fn main() {
4     // Initialize test constants in a way that cannot be determined at compile time, to ensure
5     // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
6     // dependent conditions.
7     let is_true = std::env::args().len() == 1;
8
9     let mut countdown = 0;
10
11     if
12         is_true
13     {
14         countdown
15         =
16             10
17         ;
18     }
19
20     loop
21     {
22         if
23             countdown
24                 ==
25             0
26         {
27             break
28             ;
29         }
30         countdown
31         -=
32         1
33         ;
34     }
35 }