From: Matt Corallo Date: Thu, 22 Aug 2024 22:59:49 +0000 (+0000) Subject: Handle printing generic bounds on a trait impl better X-Git-Tag: v0.0.124.0^2~16 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=358152b5dab4befdc1cd0472162780ea4ed07766;p=ldk-c-bindings Handle printing generic bounds on a trait impl better --- diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 877331e..51efa24 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -3127,9 +3127,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // If this is a no-export'd crate and there's only one implementation in the // whole crate, just treat it as a reference to whatever the implementor is. if with_ref_lifetime { - // Hope we're being printed in function generics and let rustc derive the - // type. - write!(w, "_").unwrap(); + // Hope that we're bound on a `Deref` and that the non-ref type works. + write!(w, "crate::{}", trait_impls[0]).unwrap(); } else { write!(w, "&crate::{}", trait_impls[0]).unwrap(); }