projects
/
ldk-c-bindings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
15635d0
)
Accept `DerefMut` bounds on generics as if they were `Deref`
author
Matt Corallo
<git@bluematt.me>
Thu, 28 Sep 2023 00:32:55 +0000
(
00:32
+0000)
committer
Matt Corallo
<git@bluematt.me>
Thu, 28 Sep 2023 02:28:35 +0000
(
02:28
+0000)
c-bindings-gen/src/types.rs
patch
|
blob
|
history
diff --git
a/c-bindings-gen/src/types.rs
b/c-bindings-gen/src/types.rs
index 99b333c01d5fbfc723a9e11a11d6b191bbf84bf7..4328e9c5e262578b5d23c29c2ffc51aacaec019e 100644
(file)
--- 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 == "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);
let p = string_path_to_syn_path(&path);
let ref_ty = parse_quote!(&#p);
let mut_ref_ty = parse_quote!(&mut #p);
@@
-347,7
+348,8
@@
impl<'a, 'p: 'a> GenericTypes<'a, 'p> {
// implement Deref<Target=Self> for relevant types). We don't
// bother to implement it for associated types, however, so we just
// ignore such bounds.
// implement Deref<Target=Self> 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!(); }
self.typed_generics.insert(&t.ident, path);
}
} else { unimplemented!(); }