Do not use blanket impls when building for `c_bindings`
authorMatt Corallo <git@bluematt.me>
Sat, 10 Sep 2022 20:31:42 +0000 (20:31 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 12 Sep 2022 16:26:58 +0000 (16:26 +0000)
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)]`.

lightning/src/routing/scoring.rs

index a2492accf59cd9fe33fdf9d8ed533d8ff234c5a4..a3d970715872433d40572d98301b0309419876ab 100644 (file)
@@ -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)