From: Matt Corallo Date: Fri, 2 Oct 2020 01:24:32 +0000 (-0400) Subject: [bindings] Handle ::-prefixed paths in a few places X-Git-Tag: v0.0.12~7^2~12 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=00fb152758261ff6274b732bccaa211ed8321d06;p=rust-lightning [bindings] Handle ::-prefixed paths in a few places --- diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 9094987fa..14b2826f1 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -878,8 +878,9 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { } else { p_arg }; if p.leading_colon.is_some() { - // At some point we may need this, but for now, its unused, so just fail. - return None; + Some(p.segments.iter().enumerate().map(|(idx, seg)| { + format!("{}{}", if idx == 0 { "" } else { "::" }, seg.ident) + }).collect()) } else if let Some(id) = p.get_ident() { self.maybe_resolve_ident(id) } else { @@ -1158,7 +1159,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { ptr_for_ref, tupleconv, prefix, sliceconv, path_lookup, decl_lookup); }, syn::Type::Path(p) => { - if p.qself.is_some() || p.path.leading_colon.is_some() { + if p.qself.is_some() { unimplemented!(); } @@ -1471,7 +1472,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { } }, syn::Type::Path(p) => { - if p.qself.is_some() || p.path.leading_colon.is_some() { + if p.qself.is_some() { unimplemented!(); } let resolved_path = self.resolve_path(&p.path, generics);