From cd178385527ffe4e15b935005df984fc042be30f Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 25 Apr 2023 17:14:37 +0000 Subject: [PATCH] Replace type resolution assertions with failures Type resolution now supports failing, but some assertions are still left over from when it didn't. Replace some of those which now fail on LDK 0.0.115. --- c-bindings-gen/src/types.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index c02b1dd..b92ca77 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -2685,10 +2685,16 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { } else if let syn::Type::Path(p_arg) = t { if let Some(resolved) = self.maybe_resolve_path(&p_arg.path, generics) { if !self.is_primitive(&resolved) { - assert!(!is_ref); // We don't currently support outer reference types for non-primitive inners + if is_ref { + // We don't currently support outer reference types for non-primitive inners + return false; + } } } else { - assert!(!is_ref); // We don't currently support outer reference types for non-primitive inners + if is_ref { + // We don't currently support outer reference types for non-primitive inners + return false; + } } if !self.write_c_type_intern(w, t, generics, false, false, false, true, true) { return false; } } else { -- 2.39.5