From 358152b5dab4befdc1cd0472162780ea4ed07766 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 22 Aug 2024 22:59:49 +0000 Subject: [PATCH] Handle printing generic bounds on a trait impl better --- c-bindings-gen/src/types.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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(); } -- 2.39.5