File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
c2rust-transpile/src/translator Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,10 @@ impl<'c> Translation<'c> {
334334 . borrow ( )
335335 . resolve_decl_name ( union_id)
336336 . unwrap ( ) ;
337+ if let Some ( cur_file) = self . cur_file . get ( ) {
338+ log:: debug!( "in file {cur_file} importing union {union_name}, id {union_id:?}" ) ;
339+ self . add_import ( cur_file, union_id, & union_name) ;
340+ }
337341 match self . ast_context . index ( union_field_id) . kind {
338342 CDeclKind :: Field { typ : field_ty, .. } => {
339343 let val = if ids. is_empty ( ) {
Original file line number Diff line number Diff line change @@ -398,6 +398,10 @@ impl<'a> Translation<'a> {
398398 field_expr_ids : & [ CExprId ] ,
399399 ) -> TranslationResult < WithStmts < Box < Expr > > > {
400400 let name = self . resolve_decl_inner_name ( struct_id) ;
401+ if let Some ( cur_file) = self . cur_file . get ( ) {
402+ log:: debug!( "in file {cur_file} importing struct {name}, id {struct_id:?}" ) ;
403+ self . add_import ( cur_file, struct_id, & name) ;
404+ }
401405
402406 let ( field_decl_ids, platform_byte_size) = match self . ast_context . index ( struct_id) . kind {
403407 CDeclKind :: Struct {
You can’t perform that action at this time.
0 commit comments