@@ -662,7 +662,9 @@ impl Type {
662
662
CXType_VariableArray |
663
663
CXType_DependentSizedArray |
664
664
CXType_IncompleteArray => {
665
- let inner = Item :: from_ty ( & ty. elem_type ( ) , location, parent_id, ctx)
665
+ let inner = Item :: from_ty ( ty. elem_type ( ) . as_ref ( )
666
+ . expect ( "Not an appropriate type?" ) ,
667
+ location, parent_id, ctx)
666
668
. expect ( "Not able to resolve array element?" ) ;
667
669
TypeKind :: Pointer ( inner)
668
670
}
@@ -694,14 +696,18 @@ impl Type {
694
696
// That being said, that should be fixed eventually.
695
697
CXType_Vector |
696
698
CXType_ConstantArray => {
697
- let inner = Item :: from_ty ( & ty. elem_type ( ) , location, parent_id, ctx)
699
+ let inner = Item :: from_ty ( ty. elem_type ( ) . as_ref ( )
700
+ . expect ( "Not an appropriate type?" ) ,
701
+ location, parent_id, ctx)
698
702
. expect ( "Not able to resolve array element?" ) ;
699
703
TypeKind :: Array ( inner, ty. num_elements ( ) . unwrap ( ) )
700
704
}
701
705
// A complex number is always a real and an imaginary part, so
702
706
// represent that as a two-item array.
703
707
CXType_Complex => {
704
- let inner = Item :: from_ty ( & ty. elem_type ( ) , location, parent_id, ctx)
708
+ let inner = Item :: from_ty ( ty. elem_type ( ) . as_ref ( )
709
+ . expect ( "Not an appropriate type?" ) ,
710
+ location, parent_id, ctx)
705
711
. expect ( "Not able to resolve array element?" ) ;
706
712
TypeKind :: Array ( inner, 2 )
707
713
}
0 commit comments