From 9d79103585a215d97ba565744e0695dc8861f5f7 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 28 Sep 2023 01:16:56 +0000 Subject: [PATCH] Print fewer types in call generics, leaning on rustc to pick types Picking types is hard, its easier to make rustc do it. --- c-bindings-gen/src/types.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 9df1bd1..5f9e581 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -3070,7 +3070,9 @@ 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 { - write!(w, "&'static crate::{}", trait_impls[0]).unwrap(); + // Hope we're being printed in function generics and let rustc derive the + // type. + write!(w, "_").unwrap(); } else { write!(w, "&crate::{}", trait_impls[0]).unwrap(); } -- 2.39.5