From: Matt Corallo Date: Wed, 22 Jun 2022 19:59:45 +0000 (+0000) Subject: Add locally defined crates as "dependencies" without `extern crate` X-Git-Tag: v0.0.108.0^2~5 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=d31c25fdc689326bedf028edaa9abb3f0fe7efa6;p=ldk-c-bindings Add locally defined crates as "dependencies" without `extern crate` We later use the `dependency` set when doing type resolution to decide if `::asdf::T` means `current_crate::asdf::T` or `asdf::T`, which will resolve incorrectly if we don't ensure all possible crates are in the `dependencies` list. --- diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index bc015f0..1a737d1 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -705,6 +705,7 @@ impl FullLibraryAST { let modname = if module != "" { module.clone() + "::" + &modident } else { + self.dependencies.insert(m.ident); modident.clone() }; self.load_module(modname, m.attrs, m.content.unwrap().1);