File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -655,13 +655,25 @@ impl CodeGenerator for CompInfo {
655
655
// also don't output template specializations, neither total or partial.
656
656
//
657
657
// TODO: Generate layout tests for template specializations, yay!
658
+
659
+ // TODO (imp): I will keep it like that right now and move it to function later
658
660
if self . has_non_type_template_params ( ) ||
659
661
self . is_template_specialization ( ) {
660
662
let layout = item. kind ( ) . expect_type ( ) . layout ( ctx) ;
661
663
let canonical_name = item. canonical_name ( ctx) ;
662
664
663
665
if let Some ( layout) = layout {
664
- let fn_name = format ! ( "bindgen_test_layout_template_{}" , canonical_name) ;
666
+
667
+ let mut types = String :: new ( ) ;
668
+
669
+ for arg in self . template_args ( ) {
670
+ if let Some ( name) = ctx. resolve_type ( * arg) . name ( ) {
671
+ // hope this isn't bad
672
+ types. push_str ( format ! ( "{}_" , name) . as_str ( ) ) ;
673
+ }
674
+ }
675
+
676
+ let fn_name = format ! ( "bindgen_test_layout_template_{}_{}" , canonical_name, types) ;
665
677
let fn_name = ctx. rust_ident_raw ( & fn_name) ;
666
678
let ident = item. to_rust_ty ( ctx) ;
667
679
let prefix = ctx. trait_prefix ( ) ;
You can’t perform that action at this time.
0 commit comments