From f7f7500da58b0999ae4f63d27efb67a91586f4fe Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 1 Mar 2021 17:08:51 -0500 Subject: [PATCH] [bindings] Handle ::-containing paths in generics Specifically, this is required for some paths which use `Option`. --- c-bindings-gen/src/types.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 3e6acaa8d..ad21b4c6b 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -1946,11 +1946,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { if !self.write_c_path_intern(w, &$p_arg.path, generics, true, true, true) { return false; } } } else { - if $p_arg.path.segments.len() == 1 { - write!(w, "{}", $p_arg.path.segments.iter().next().unwrap().ident).unwrap(); - } else { - return false; - } + write!(w, "{}", $p_arg.path.segments.last().unwrap().ident).unwrap(); } } else if self.is_known_container(&subtype, is_ref) || self.is_transparent_container(&subtype, is_ref) { if !self.write_c_mangled_container_path_intern(w, Self::path_to_generic_args(&$p_arg.path), generics, -- 2.39.5