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 {
320320 }
321321}
322322
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-
333323#[ cfg( all( span_locations, not( fuzzing) ) ) ]
334324thread_local ! {
335325 static SOURCE_MAP : RefCell <SourceMap > = RefCell :: new( SourceMap {
336326 // Start with a single dummy file which all call_site() and def_site()
337327 // 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+ } ] ,
339334 } ) ;
340335}
341336
342337#[ cfg( all( span_locations, not( fuzzing) ) ) ]
343338pub 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 ) ) ;
348340}
349341
350342#[ cfg( all( span_locations, not( fuzzing) ) ) ]
You can’t perform that action at this time.
0 commit comments