fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.4 KiB45 linesraw
1   LL|       |#![allow(unused_assignments, unused_variables)]
2   LL|       |
3   LL|      1|fn main() {
4   LL|      1|    // Initialize test constants in a way that cannot be determined at compile time, to ensure
5   LL|      1|    // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
6   LL|      1|    // dependent conditions.
7   LL|      1|    let is_true = std::env::args().len() == 1;
8   LL|      1|
9   LL|      1|    let mut countdown = 1;
10   LL|      1|    if is_true {
11   LL|      1|        countdown = 0;
12   LL|      1|    }
13                   ^0
14   LL|       |
15   LL|       |    for
16   LL|       |        _
17   LL|       |    in
18   LL|      3|        0..2
19   LL|       |    {
20   LL|       |        let z
21   LL|       |        ;
22   LL|       |        match
23   LL|      2|            countdown
24   LL|       |        {
25   LL|      1|            x
26   LL|       |            if
27   LL|      2|                x
28   LL|      2|                    <
29   LL|      2|                1
30   LL|       |            =>
31   LL|      1|            {
32   LL|      1|                z = countdown
33   LL|      1|                ;
34   LL|      1|                let y = countdown
35   LL|      1|                ;
36   LL|      1|                countdown = 10
37   LL|      1|                ;
38   LL|      1|            }
39   LL|       |            _
40   LL|       |            =>
41   LL|      1|            {}
42   LL|       |        }
43   LL|       |    }
44   LL|      1|}
45