File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -320,31 +320,23 @@ impl Debug for SourceFile {
320
320
}
321
321
}
322
322
323
- #[ cfg( all( span_locations, not( fuzzing) ) ) ]
324
- fn dummy_file ( ) -> FileInfo {
325
- FileInfo {
326
- source_text : String :: new ( ) ,
327
- span : Span { lo : 0 , hi : 0 } ,
328
- lines : vec ! [ 0 ] ,
329
- char_index_to_byte_offset : BTreeMap :: new ( ) ,
330
- }
331
- }
332
-
333
323
#[ cfg( all( span_locations, not( fuzzing) ) ) ]
334
324
thread_local ! {
335
325
static SOURCE_MAP : RefCell <SourceMap > = RefCell :: new( SourceMap {
336
326
// Start with a single dummy file which all call_site() and def_site()
337
327
// spans reference.
338
- files: vec![ dummy_file( ) ] ,
328
+ files: vec![ FileInfo {
329
+ source_text: String :: new( ) ,
330
+ span: Span { lo: 0 , hi: 0 } ,
331
+ lines: vec![ 0 ] ,
332
+ char_index_to_byte_offset: BTreeMap :: new( ) ,
333
+ } ] ,
339
334
} ) ;
340
335
}
341
336
342
337
#[ cfg( all( span_locations, not( fuzzing) ) ) ]
343
338
pub fn invalidate_current_thread_spans ( ) {
344
- SOURCE_MAP . with ( |sm| {
345
- let mut sm = sm. borrow_mut ( ) ;
346
- sm. files = vec ! [ dummy_file( ) ] ;
347
- } ) ;
339
+ SOURCE_MAP . with ( |sm| sm. borrow_mut ( ) . files . truncate ( 1 ) ) ;
348
340
}
349
341
350
342
#[ cfg( all( span_locations, not( fuzzing) ) ) ]
You can’t perform that action at this time.
0 commit comments