From e5bc76faef879b3fc059263e445b03e6a9435bb9 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 17 Jul 2021 17:39:44 +0000 Subject: [PATCH] Correct args passed to supertrait C methods in subtrait impls --- c-bindings-gen/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 9693e3d..b08f234 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -427,7 +427,9 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty } write_method_var_decl_body(w, &m.sig, "\t", $type_resolver, Some(&meth_gen_types), true); write!(w, "(self{}.{})(", $impl_accessor, m.sig.ident).unwrap(); - write_method_call_params(w, &m.sig, "\t", $type_resolver, Some(&meth_gen_types), "", true); + let mut args = Vec::new(); + write_method_call_params(&mut args, &m.sig, "\t", $type_resolver, Some(&meth_gen_types), "", true); + w.write_all(String::from_utf8(args).unwrap().replace("self", &format!("self{}", $impl_accessor)).as_bytes()).unwrap(); writeln!(w, "\n\t}}").unwrap(); }, -- 2.39.5