@@ -316,11 +316,9 @@ pub(crate) fn handle_function<R: ReaderType>(
316316 } ;
317317
318318 // Alias function type in the case that it contains itself
319- if let Some ( name) = debug_info_builder_context. get_name ( dwarf, unit, entry) {
320- let ntr =
321- Type :: named_type_from_type ( & name, & Type :: function ( return_type. as_ref ( ) , vec ! [ ] , false ) ) ;
322- debug_info_builder. add_type ( get_uid ( dwarf, unit, entry) , name, ntr, false ) ;
323- }
319+ let name = debug_info_builder_context. get_name ( dwarf, unit, entry) . unwrap_or ( "_unnamed_func" . to_string ( ) ) ;
320+ let ntr = Type :: named_type_from_type ( & name, & Type :: function ( return_type. as_ref ( ) , vec ! [ ] , false ) ) ;
321+ debug_info_builder. add_type ( get_uid ( dwarf, unit, entry) , name, ntr, false ) ;
324322
325323 let mut parameters: Vec < FunctionParameter > = vec ! [ ] ;
326324 let mut variable_arguments = false ;
@@ -350,12 +348,8 @@ pub(crate) fn handle_function<R: ReaderType>(
350348 }
351349 }
352350
353- if debug_info_builder_context
354- . get_name ( dwarf, unit, entry)
355- . is_some ( )
356- {
357- debug_info_builder. remove_type ( get_uid ( dwarf, unit, entry) ) ;
358- }
351+ // Remove the aliased type from the builder.
352+ debug_info_builder. remove_type ( get_uid ( dwarf, unit, entry) ) ;
359353
360354 Some ( Type :: function (
361355 return_type. as_ref ( ) ,
0 commit comments