]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Don't attempt to check if a reference is clonable
authorMatt Corallo <git@bluematt.me>
Mon, 26 Aug 2024 23:28:51 +0000 (23:28 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 3 Sep 2024 18:55:34 +0000 (18:55 +0000)
`is_clonable` will only work for non-reference types, so this check
was actually generally always false.

c-bindings-gen/src/types.rs

index 384b4d42d2693acd54861eeb3b78f66412f3589e..a1ec4e11d7ffea6c21f00a5fc34fcc199e35514a 100644 (file)
@@ -3210,7 +3210,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                                true
                                        } else {
                                                let mut inner_c_ty = Vec::new();
-                                               assert!(self.write_c_path_intern(&mut inner_c_ty, &p.path, generics, true, false, ptr_for_ref, with_ref_lifetime, c_ty));
+                                               assert!(self.write_c_path_intern(&mut inner_c_ty, &p.path, generics, false, false, ptr_for_ref, with_ref_lifetime, c_ty));
                                                let inner_ty_str = String::from_utf8(inner_c_ty).unwrap();
                                                if self.is_clonable(&inner_ty_str) {
                                                        let inner_ty_ident = inner_ty_str.rsplitn(2, "::").next().unwrap();