]> git.lizzy.rs Git - rust.git/blob - tests/run-make/coverage-reports/expected_show_coverage.uses_inline_crate.txt
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
[rust.git] / tests / run-make / coverage-reports / expected_show_coverage.uses_inline_crate.txt
1     1|       |#![allow(unused_assignments, unused_variables)]
2     2|       |
3     3|       |// compile-flags: -C opt-level=3 # validates coverage now works with optimizations
4     4|       |
5     5|       |use std::fmt::Debug;
6     6|       |
7     7|      1|pub fn used_function() {
8     8|      1|    // Initialize test constants in a way that cannot be determined at compile time, to ensure
9     9|      1|    // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
10    10|      1|    // dependent conditions.
11    11|      1|    let is_true = std::env::args().len() == 1;
12    12|      1|    let mut countdown = 0;
13    13|      1|    if is_true {
14    14|      1|        countdown = 10;
15    15|      1|    }
16                    ^0
17    16|      1|    use_this_lib_crate();
18    17|      1|}
19    18|       |
20    19|       |#[inline(always)]
21    20|      1|pub fn used_inline_function() {
22    21|      1|    // Initialize test constants in a way that cannot be determined at compile time, to ensure
23    22|      1|    // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
24    23|      1|    // dependent conditions.
25    24|      1|    let is_true = std::env::args().len() == 1;
26    25|      1|    let mut countdown = 0;
27    26|      1|    if is_true {
28    27|      1|        countdown = 10;
29    28|      1|    }
30                    ^0
31    29|      1|    use_this_lib_crate();
32    30|      1|}
33    31|       |
34    32|       |
35    33|       |
36    34|       |
37    35|       |
38    36|       |
39    37|       |
40    38|       |#[inline(always)]
41    39|      2|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
42    40|      2|    println!("used_only_from_bin_crate_generic_function with {:?}", arg);
43    41|      2|}
44   ------------------
45   | used_inline_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>>:
46   |   39|      1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
47   |   40|      1|    println!("used_only_from_bin_crate_generic_function with {:?}", arg);
48   |   41|      1|}
49   ------------------
50   | used_inline_crate::used_only_from_bin_crate_generic_function::<&str>:
51   |   39|      1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
52   |   40|      1|    println!("used_only_from_bin_crate_generic_function with {:?}", arg);
53   |   41|      1|}
54   ------------------
55   | Unexecuted instantiation: used_inline_crate::used_only_from_bin_crate_generic_function::<_>
56   ------------------
57    42|       |// Expect for above function: `Unexecuted instantiation` (see notes in `used_crate.rs`)
58    43|       |
59    44|       |#[inline(always)]
60    45|      4|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
61    46|      4|    println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
62    47|      4|}
63   ------------------
64   | used_inline_crate::used_only_from_this_lib_crate_generic_function::<&str>:
65   |   45|      2|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
66   |   46|      2|    println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
67   |   47|      2|}
68   ------------------
69   | used_inline_crate::used_only_from_this_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
70   |   45|      2|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
71   |   46|      2|    println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
72   |   47|      2|}
73   ------------------
74    48|       |
75    49|       |#[inline(always)]
76    50|      3|pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
77    51|      3|    println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
78    52|      3|}
79   ------------------
80   | used_inline_crate::used_from_bin_crate_and_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
81   |   50|      1|pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
82   |   51|      1|    println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
83   |   52|      1|}
84   ------------------
85   | used_inline_crate::used_from_bin_crate_and_lib_crate_generic_function::<&str>:
86   |   50|      2|pub fn used_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
87   |   51|      2|    println!("used_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
88   |   52|      2|}
89   ------------------
90    53|       |
91    54|       |#[inline(always)]
92    55|      3|pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
93    56|      3|    println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
94    57|      3|}
95   ------------------
96   | used_inline_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str>:
97   |   55|      1|pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
98   |   56|      1|    println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
99   |   57|      1|}
100   ------------------
101   | used_inline_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str>:
102   |   55|      2|pub fn used_with_same_type_from_bin_crate_and_lib_crate_generic_function<T: Debug>(arg: T) {
103   |   56|      2|    println!("used_with_same_type_from_bin_crate_and_lib_crate_generic_function with {:?}", arg);
104   |   57|      2|}
105   ------------------
106    58|       |
107    59|       |#[inline(always)]
108    60|      0|pub fn unused_generic_function<T: Debug>(arg: T) {
109    61|      0|    println!("unused_generic_function with {:?}", arg);
110    62|      0|}
111    63|       |
112    64|       |#[inline(always)]
113    65|      0|pub fn unused_function() {
114    66|      0|    let is_true = std::env::args().len() == 1;
115    67|      0|    let mut countdown = 2;
116    68|      0|    if !is_true {
117    69|      0|        countdown = 20;
118    70|      0|    }
119    71|      0|}
120    72|       |
121    73|       |#[inline(always)]
122    74|      0|fn unused_private_function() {
123    75|      0|    let is_true = std::env::args().len() == 1;
124    76|      0|    let mut countdown = 2;
125    77|      0|    if !is_true {
126    78|      0|        countdown = 20;
127    79|      0|    }
128    80|      0|}
129    81|       |
130    82|      2|fn use_this_lib_crate() {
131    83|      2|    used_from_bin_crate_and_lib_crate_generic_function("used from library used_crate.rs");
132    84|      2|    used_with_same_type_from_bin_crate_and_lib_crate_generic_function(
133    85|      2|        "used from library used_crate.rs",
134    86|      2|    );
135    87|      2|    let some_vec = vec![5, 6, 7, 8];
136    88|      2|    used_only_from_this_lib_crate_generic_function(some_vec);
137    89|      2|    used_only_from_this_lib_crate_generic_function("used ONLY from library used_crate.rs");
138    90|      2|}
139