From 7b9fa4430067acbe2fdf999d65d67c9e55ed3f5a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 22 Jun 2022 19:59:45 +0000 Subject: [PATCH] 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. --- c-bindings-gen/src/types.rs | 1 + 1 file changed, 1 insertion(+) 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); -- 2.30.2