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>
Fri, 24 Jun 2022 21:27:19 +0000 (21:27 +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 18accad08bb60d76a3f3dbc4c42ff1dba6e8b153..c104fb35ff47c86f5857ce3c787877294bc97eb6 100644 (file)
@@ -701,6 +701,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);