[bindings] Allow resolution of private types in some cases
[rust-lightning] / c-bindings-gen / src / main.rs
index 198e0cfdd3912b1e1d73b39be1b0a60ba32c46b2..f8e5b48492fd3944ca4775b7d593025f8ee79f0c 100644 (file)
@@ -1165,9 +1165,12 @@ impl FullLibraryAST {
                                                        };
                                                        self.load_module(modname, m.attrs, m.content.unwrap().1);
                                                        submods.push(modident);
+                                               } else {
+                                                       non_mod_items.push(syn::Item::Mod(m));
                                                }
                                        }
                                },
+                               syn::Item::Mod(_) => panic!("--pretty=expanded output should never have non-body modules"),
                                _ => { non_mod_items.push(item); }
                        }
                }