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 @@ -494,10 +494,6 @@ pub fn translate(
494494 {
495495 t. use_crate ( ExternCrate :: Libc ) ;
496496
497- // Sort the top-level declarations by file and source location so that we
498- // preserve the ordering of all declarations in each file.
499- t. ast_context . sort_top_decls ( ) ;
500-
501497 t. locate_comments ( ) ;
502498
503499 // Headers often pull in declarations that are unused;
@@ -741,6 +737,10 @@ pub fn translate(
741737 } )
742738 . collect :: < HashMap < _ , _ > > ( ) ;
743739
740+ // Sort the top-level declarations by file and source location so that we
741+ // preserve the ordering of all declarations in each file.
742+ t. ast_context . sort_top_decls ( ) ;
743+
744744 for top_id in & t. ast_context . c_decls_top {
745745 let decl = t. ast_context . get_decl ( top_id) . unwrap ( ) ;
746746 let decl_file_id = t. ast_context . file_id ( decl) ;
You can’t perform that action at this time.
0 commit comments