fork/rust

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

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

master
1.7 KiB53 linesraw
1   LL|       |// Regression test for #115930.
2   LL|       |// All of these closures are identical, and should produce identical output in
3   LL|       |// the coverage report. However, an unstable sort was causing them to be treated
4   LL|       |// inconsistently when preparing coverage spans.
5   LL|       |
6   LL|      1|fn main() {
7   LL|      1|    let truthy = std::env::args().len() == 1;
8   LL|      1|
9   LL|      1|    let a
10   LL|       |        =
11   LL|       |        |
12   LL|       |        |
13   LL|      2|        if truthy { true } else { false };
14                                                ^0
15   LL|       |
16   LL|      1|    a();
17   LL|      1|    if truthy { a(); }
18                                    ^0
19   LL|       |
20   LL|      1|    let b
21   LL|       |        =
22   LL|       |        |
23   LL|       |        |
24   LL|      2|        if truthy { true } else { false };
25                                                ^0
26   LL|       |
27   LL|      1|    b();
28   LL|      1|    if truthy { b(); }
29                                    ^0
30   LL|       |
31   LL|      1|    let c
32   LL|       |        =
33   LL|       |        |
34   LL|       |        |
35   LL|      2|        if truthy { true } else { false };
36                                                ^0
37   LL|       |
38   LL|      1|    c();
39   LL|      1|    if truthy { c(); }
40                                    ^0
41   LL|       |
42   LL|      1|    let d
43   LL|       |        =
44   LL|       |        |
45   LL|       |        |
46   LL|      2|        if truthy { true } else { false };
47                                                ^0
48   LL|       |
49   LL|      1|    d();
50   LL|      1|    if truthy { d(); }
51                                    ^0
52   LL|      1|}
53