X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=c-bindings-gen%2Fsrc%2Ftypes.rs;h=bd04ba2b8c590889b2b5c4f74b5ffa32f2637cb6;hb=072a9e1c2b85291f6acbf21ab83f38ecd6325cb5;hp=0c4c1d88694e3c5637cd60efb108ef9806894b1c;hpb=8fc17a2e5daa8f6f7c515639d2cb7ffea5221406;p=ldk-c-bindings diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 0c4c1d8..bd04ba2 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -223,6 +223,15 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { if let Some(path) = types.maybe_resolve_path(&trait_bound.path, None) { if types.skip_path(&path) { continue; } if path == "Sized" { continue; } + if path == "core::fmt::Debug" { + // #[derive(Debug)] will add Debug bounds on each genericin the + // auto-generated impl. In cases where the existing generic + // bound already requires Debug this is redundant and should be + // ignored (which we do here). However, in cases where this is + // not redundant, this may cause spurious Debug impls which may + // fail to compile. + continue; + } if non_lifetimes_processed { return false; } non_lifetimes_processed = true; if path != "std::ops::Deref" && path != "core::ops::Deref" &&