From: Matt Corallo Date: Sat, 10 Sep 2022 20:31:42 +0000 (+0000) Subject: Do not use blanket impls when building for `c_bindings` X-Git-Tag: v0.0.111~1^2~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=0f3536f87a73b378c3df7867f45d23a4559c3f8d;p=rust-lightning Do not use blanket impls when building for `c_bindings` The C bindings generator isn't capable of figuring out if a blanket impl applies in a given context, and instead opts to always write out any relevant impl's for a trait. Thus, blanket impls should be disabled when building with `#[cfg(c_bindings)]`. --- diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index a2492accf..a3d970715 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -162,6 +162,7 @@ pub trait LockableScore<'a> { /// use the Persister to persist it. pub trait WriteableScore<'a>: LockableScore<'a> + Writeable {} +#[cfg(not(c_bindings))] impl<'a, T> WriteableScore<'a> for T where T: LockableScore<'a> + Writeable {} /// (C-not exported)