Perform topological sort of structs earlier during type checking
diff --git a/gen/src/write.rs b/gen/src/write.rs
index 414ea46..fd2a815 100644
--- a/gen/src/write.rs
+++ b/gen/src/write.rs
@@ -1,7 +1,7 @@
use crate::gen::block::Block;
use crate::gen::nested::NamespaceEntries;
use crate::gen::out::OutFile;
-use crate::gen::{builtin, include, toposort, Opt};
+use crate::gen::{builtin, include, Opt};
use crate::syntax::atom::Atom::{self, *};
use crate::syntax::symbol::Symbol;
use crate::syntax::{
@@ -96,7 +96,7 @@
}
}
- for strct in toposort::sort(apis, out.types) {
+ for strct in &out.types.toposorted_structs {
out.next_section();
if !out.types.cxx.contains(&strct.name.rust) {
write_struct(out, strct);