Skip to content

Commit 358152b

Browse files
committed
Handle printing generic bounds on a trait impl better
1 parent fefaed2 commit 358152b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

c-bindings-gen/src/types.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,9 +3127,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
31273127
// If this is a no-export'd crate and there's only one implementation in the
31283128
// whole crate, just treat it as a reference to whatever the implementor is.
31293129
if with_ref_lifetime {
3130-
// Hope we're being printed in function generics and let rustc derive the
3131-
// type.
3132-
write!(w, "_").unwrap();
3130+
// Hope that we're bound on a `Deref` and that the non-ref type works.
3131+
write!(w, "crate::{}", trait_impls[0]).unwrap();
31333132
} else {
31343133
write!(w, "&crate::{}", trait_impls[0]).unwrap();
31353134
}

0 commit comments

Comments
 (0)