X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Ftypes.rs;h=ad9cd0497f9f5b4f147f9560ac7a95d7051e0c11;hb=842d2f6ce7da27ddc439501cf4025c9daaf6b0e8;hp=afe719ffe2ca11709f50f6942dbf629fc9920084;hpb=b49781e8d81dc400033c1ea6660f06eda9a87347;p=rust-lightning diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index afe719ffe..ad9cd0497 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -383,6 +383,21 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr } } }, + syn::Item::Type(t) if export_status(&t.attrs) == ExportStatus::Export => { + if let syn::Visibility::Public(_) = t.vis { + let mut process_alias = true; + for tok in t.generics.params.iter() { + if let syn::GenericParam::Lifetime(_) = tok {} + else { process_alias = false; } + } + if process_alias { + match &*t.ty { + syn::Type::Path(_) => { declared.insert(t.ident.clone(), DeclType::StructImported); }, + _ => {}, + } + } + } + }, syn::Item::Enum(e) => { if let syn::Visibility::Public(_) = e.vis { match export_status(&e.attrs) { @@ -524,6 +539,8 @@ pub struct CrateTypes<'a> { pub template_file: &'a mut File, /// Set of containers which are clonable pub clonable_types: HashSet, + /// Key impls Value + pub trait_impls: HashMap>, } /// A struct which tracks resolving rust types into C-mapped equivalents, exists for one specific