From d31c25fdc689326bedf028edaa9abb3f0fe7efa6 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.39.5