From: Matt Corallo Date: Sun, 31 Oct 2021 23:18:48 +0000 (+0000) Subject: XXX: Hax on Hax on Hax X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=911544d3a8e2164e5ac9fa98b8850617b5a39d2d;p=ldk-c-bindings XXX: Hax on Hax on Hax --- diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 0552633..cc96023 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -258,9 +258,11 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { if p.qself.is_some() { return false; } if p.path.leading_colon.is_some() { return false; } let mut p_iter = p.path.segments.iter(); - if let Some(gen) = new_typed_generics.get_mut(&p_iter.next().unwrap().ident) { - if gen.is_some() { return false; } - if &format!("{}", p_iter.next().unwrap().ident) != "Target" {return false; } +let theident = &p_iter.next().unwrap().ident; +eprintln!("Doing bound resolution on {}", theident); + if let Some(gen) = new_typed_generics.get_mut(theident) { + if gen.is_some() { eprintln!("5"); return false; } + if &format!("{}", p_iter.next().unwrap().ident) != "Target" {eprintln!("6"); return false; } let mut non_lifetimes_processed = false; for bound in t.bounds.iter() { @@ -274,8 +276,13 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { *gen = Some(types.resolve_path(&trait_bound.path, None)); } } - } else { return false; } - } else { return false; } + } else { + for bound in t.bounds.iter() { +eprintln!("XXX LULZZZZZZZZZZZZZZZZZZZZ {}", theident); + new_typed_generics.insert(theident, Some("lightning_invoice::payment::Router".to_string())); + } + } + } else { eprintln!("9"); return false; } } } }