]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Add locally defined crates as "dependencies" without `extern crate`
authorMatt Corallo <git@bluematt.me>
Wed, 22 Jun 2022 19:59:45 +0000 (19:59 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 28 Jun 2022 17:16:28 +0000 (17:16 +0000)
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.

c-bindings-gen/src/types.rs

index bc015f04bd8ecf4ec4add92e3e4c76528b2940be..1a737d17cf11203ef1720015164d75ed7e3dd060 100644 (file)
@@ -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);