@@ -27,6 +27,9 @@ use crate::llvm;
27
27
/// the final record that will be embedded in the `__llvm_covfun` section.
28
28
#[ derive( Debug ) ]
29
29
pub ( crate ) struct CovfunRecord < ' tcx > {
30
+ /// Not used directly, but helpful in debug messages.
31
+ _instance : Instance < ' tcx > ,
32
+
30
33
mangled_function_name : & ' tcx str ,
31
34
source_hash : u64 ,
32
35
is_used : bool ,
@@ -55,6 +58,7 @@ pub(crate) fn prepare_covfun_record<'tcx>(
55
58
let expressions = prepare_expressions ( ids_info) ;
56
59
57
60
let mut covfun = CovfunRecord {
61
+ _instance : instance,
58
62
mangled_function_name : tcx. symbol_name ( instance) . name ,
59
63
source_hash : if is_used { fn_cov_info. function_source_hash } else { 0 } ,
60
64
is_used,
@@ -106,7 +110,7 @@ fn fill_region_tables<'tcx>(
106
110
// first mapping's span to determine the file.
107
111
let source_map = tcx. sess . source_map ( ) ;
108
112
let Some ( first_span) = ( try { fn_cov_info. mappings . first ( ) ?. span } ) else {
109
- debug_assert ! ( false , "function has no mappings: {:?}" , covfun . mangled_function_name ) ;
113
+ debug_assert ! ( false , "function has no mappings: {covfun :?}" ) ;
110
114
return ;
111
115
} ;
112
116
let source_file = source_map. lookup_source_file ( first_span. lo ( ) ) ;
@@ -184,6 +188,7 @@ pub(crate) fn generate_covfun_record<'tcx>(
184
188
covfun : & CovfunRecord < ' tcx > ,
185
189
) {
186
190
let & CovfunRecord {
191
+ _instance,
187
192
mangled_function_name,
188
193
source_hash,
189
194
is_used,
0 commit comments