File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -713,6 +713,17 @@ impl ItemCanonicalPath for Item {
713
713
}
714
714
715
715
let mut parent_path = self . parent_id ( ) . canonical_path ( & ctx) ;
716
+ if parent_path. last ( ) . map_or ( false , |parent_name| parent_name. is_empty ( ) ) {
717
+ // This only happens (or should only happen) when we're an alias,
718
+ // and our parent is a templated alias, in which case the last
719
+ // component of the path will be empty.
720
+ let is_alias = match * self . expect_type ( ) . kind ( ) {
721
+ TypeKind :: Alias ( ..) => true ,
722
+ _ => false ,
723
+ } ;
724
+ debug_assert ! ( is_alias, "How can this ever happen?" ) ;
725
+ parent_path. pop ( ) . unwrap ( ) ;
726
+ }
716
727
parent_path. push ( self . real_canonical_name ( ctx, true ) ) ;
717
728
718
729
parent_path
Original file line number Diff line number Diff line change @@ -473,6 +473,12 @@ impl Type {
473
473
ctx) ;
474
474
}
475
475
CXCursor_TemplateTypeParameter => {
476
+ // See the comment in src/ir/comp.rs
477
+ // about the same situation.
478
+ if cur. spelling ( ) . is_empty ( ) {
479
+ return CXChildVisit_Continue ;
480
+ }
481
+
476
482
let default_type =
477
483
Item :: from_ty ( & cur. cur_type ( ) ,
478
484
Some ( * cur) ,
You can’t perform that action at this time.
0 commit comments