From 911544d3a8e2164e5ac9fa98b8850617b5a39d2d Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 31 Oct 2021 23:18:48 +0000 Subject: [PATCH] XXX: Hax on Hax on Hax --- c-bindings-gen/src/types.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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; } } } } -- 2.39.5