Print fewer types in call generics, leaning on rustc to pick types
[ldk-c-bindings] / c-bindings-gen / src / types.rs
index 9df1bd1c1ef309e13aef79f99072c3c265adf128..5f9e5812aa4a4cc56c97ad71fca2fe2bc81c3c8e 100644 (file)
@@ -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();
                                        }