]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
XXX: Hax on Hax on Hax 2021-11-hrtb-support
authorMatt Corallo <git@bluematt.me>
Sun, 31 Oct 2021 23:18:48 +0000 (23:18 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 2 Nov 2021 17:09:34 +0000 (17:09 +0000)
c-bindings-gen/src/types.rs

index 0552633d69503a381f7c8c47a107fd63e0b49cec..cc960232d9e0424a092856b1b53978030119f22d 100644 (file)
@@ -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; }
                                }
                        }
                }