File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
c2rust-transpile/src/translator Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -492,10 +492,6 @@ pub fn translate(
492492 } ;
493493
494494 {
495- // Sort the top-level declarations by file and source location so that we
496- // preserve the ordering of all declarations in each file.
497- t. ast_context . sort_top_decls ( ) ;
498-
499495 t. locate_comments ( ) ;
500496
501497 // Headers often pull in declarations that are unused;
@@ -739,6 +735,10 @@ pub fn translate(
739735 } )
740736 . collect :: < HashMap < _ , _ > > ( ) ;
741737
738+ // Sort the top-level declarations by file and source location so that we
739+ // preserve the ordering of all declarations in each file.
740+ t. ast_context . sort_top_decls ( ) ;
741+
742742 for top_id in & t. ast_context . c_decls_top {
743743 let decl = t. ast_context . get_decl ( top_id) . unwrap ( ) ;
744744 let decl_file_id = t. ast_context . file_id ( decl) ;
You can’t perform that action at this time.
0 commit comments