X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Ftypes.rs;h=4328e9c5e262578b5d23c29c2ffc51aacaec019e;hb=1afc4ccc5073ab6dd99def164c9891a733c11688;hp=0ff81f8132d81f748045b080c1f7932b7cfa6992;hpb=f88af9aa921bde9f84d86f11df40b6623ba45fb5;p=ldk-c-bindings diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 0ff81f8..4328e9c 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -225,7 +225,8 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { if path == "Sized" { continue; } if non_lifetimes_processed { return false; } non_lifetimes_processed = true; - if path != "std::ops::Deref" && path != "core::ops::Deref" { + if path != "std::ops::Deref" && path != "core::ops::Deref" && + path != "std::ops::DerefMut" && path != "core::ops::DerefMut" { let p = string_path_to_syn_path(&path); let ref_ty = parse_quote!(&#p); let mut_ref_ty = parse_quote!(&mut #p); @@ -347,14 +348,14 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { // implement Deref for relevant types). We don't // bother to implement it for associated types, however, so we just // ignore such bounds. - if path != "std::ops::Deref" && path != "core::ops::Deref" { + if path != "std::ops::Deref" && path != "core::ops::Deref" && + path != "std::ops::DerefMut" && path != "core::ops::DerefMut" { self.typed_generics.insert(&t.ident, path); } } else { unimplemented!(); } for bound in bounds_iter { if let syn::TypeParamBound::Trait(t) = bound { // We only allow for `?Sized` here. - if let syn::TraitBoundModifier::Maybe(_) = t.modifier {} else { panic!(); } assert_eq!(t.path.segments.len(), 1); assert_eq!(format!("{}", t.path.segments[0].ident), "Sized"); } @@ -549,6 +550,7 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr Self::insert_primitive(&mut imports, "bool"); Self::insert_primitive(&mut imports, "u128"); Self::insert_primitive(&mut imports, "i64"); + Self::insert_primitive(&mut imports, "f64"); Self::insert_primitive(&mut imports, "u64"); Self::insert_primitive(&mut imports, "u32"); Self::insert_primitive(&mut imports, "u16"); @@ -951,6 +953,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { match full_path { "bool" => true, "i64" => true, + "f64" => true, "u64" => true, "u32" => true, "u16" => true,