fork/rust

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

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

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