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-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=commitdiff_plain;h=7b9fa4430067acbe2fdf999d65d67c9e55ed3f5a 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);