]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/coverage/if.rs
Auto merge of #99182 - RalfJung:mitigate-uninit, r=scottmcm
[rust.git] / src / test / run-make-fulldeps / coverage / if.rs
1 #![allow(unused_assignments, unused_variables)]
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
8     is_true
9     =
10         std::env::args().len()
11     ==
12         1
13     ;
14     let
15         mut
16     countdown
17     =
18         0
19     ;
20     if
21         is_true
22     {
23         countdown
24         =
25             10
26         ;
27     }
28 }