File tree Expand file tree Collapse file tree
cpp2rust/converter/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1635,8 +1635,8 @@ std::string ConverterRefCount::GetDefaultAsString(clang::QualType qual_type) {
16351635 if (pointee_type->isVoidType ()) {
16361636 ret = " AnyPtr::default()" ;
16371637 } else {
1638- ret = std::format ( " Ptr::<{}>::null() " ,
1639- GetUnsafeTypeAsString (pointee_type ));
1638+ PushConversionKind push (* this , ConversionKind::Unboxed);
1639+ ret = std::format ( " Ptr::<{}>::null() " , ConvertPointeeType (qual_type ));
16401640 }
16411641 }
16421642 } else if (auto *array_type =
@@ -2240,14 +2240,14 @@ std::string ConverterRefCount::ConvertMappedMethodCall(
22402240}
22412241
22422242std::string ConverterRefCount::ConvertPointeeType (clang::QualType ptr_type) {
2243+ assert (!ptr_type.isNull () && ptr_type->isPointerType ());
22432244 if (ptr_type->getPointeeType ()->isIntegerType ()) {
22442245 return ToString (ptr_type->getPointeeType ());
22452246 }
22462247
22472248 // Pointee of a pointer to incomplete type is an incomplete type that does
22482249 // not have a translation rule. Hence ToString(ptr_type->getPointeeType()) is
22492250 // not enough
2250- assert (ptr_type->isPointerType ());
22512251 auto str = ToString (ptr_type);
22522252 Unwrap (str, " Ptr<" , " >" );
22532253 return str;
You can’t perform that action at this time.
0 commit comments