fork/rust

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

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

master
1.1 KiB37 linesraw
1   LL|       |#![allow(unused_assignments)]
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 = 0;
10   LL|      1|
11   LL|      1|    if
12   LL|      1|        is_true
13   LL|      1|    {
14   LL|      1|        countdown
15   LL|      1|        =
16   LL|      1|            10
17   LL|      1|        ;
18   LL|      1|    }
19                   ^0
20   LL|       |
21   LL|       |    loop
22   LL|       |    {
23   LL|       |        if
24   LL|     11|            countdown
25   LL|     11|                ==
26   LL|     11|            0
27   LL|       |        {
28   LL|      1|            break
29   LL|       |            ;
30   LL|     10|        }
31   LL|     10|        countdown
32   LL|     10|        -=
33   LL|     10|        1
34   LL|       |        ;
35   LL|       |    }
36   LL|      1|}
37