From f381f78f749c4a2ba293f7b1ccfbef39a3a3291b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 22 Sep 2021 23:15:20 +0000 Subject: [PATCH] Call methods explicitly on traits to avoid to deref recursion --- c-bindings-gen/src/types.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 96a4135..efd6b9a 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -1922,7 +1922,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { DeclType::EnumIgnored|DeclType::StructImported if !is_ref => write!(w, "crate::{} {{ inner: ObjOps::heap_alloc(", decl_path).unwrap(), DeclType::Trait(_) if is_ref => write!(w, "").unwrap(), - DeclType::Trait(_) if !is_ref => {}, + DeclType::Trait(_) if !is_ref => write!(w, "Into::into(").unwrap(), _ => panic!("{:?}", decl_path), } }); @@ -1948,7 +1948,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { // for use when a Rust trait method returns an associated type. // Because all of our C traits implement From // we can just call .into() here and be done. - write!(w, ".into()").unwrap() + write!(w, ")").unwrap() }, _ => unimplemented!(), }); -- 2.39.5