@@ -1823,7 +1823,7 @@ impl Stmt {
18231823
18241824 let ty = value. guess_type ( id. location ( ) ) ;
18251825
1826- if ty. is_cf_type_ptr ( ) || ty . is_object_like_ptr ( ) {
1826+ if ty. is_object_like_ptr ( ) {
18271827 // cf_string! and ns_string! are not supported (since they cannot
18281828 // yet be used in `const`).
18291829 return None ;
@@ -3024,15 +3024,24 @@ impl Stmt {
30243024 write ! ( f, "{vis} {unsafe_}{}fn {fn_name}(" , abi. extern_outer( ) ) ?;
30253025 for ( i, ( param, arg_ty) ) in arguments. iter ( ) . enumerate ( ) {
30263026 if i == 0 && * first_arg_is_self {
3027- write ! ( f, "self: " ) ?;
3027+ // Might not be completely correct, but typeck
3028+ // should figure out for us when calling the
3029+ // inner function if the argument type isn't
3030+ // the same type this one.
3031+ if arg_ty. is_object_like_ptr ( ) {
3032+ write ! ( f, "&self" ) ?;
3033+ } else {
3034+ write ! ( f, "self" ) ?;
3035+ }
30283036 } else {
30293037 let param = handle_reserved ( & crate :: to_snake_case ( param) ) ;
30303038 write ! ( f, "{param}: " ) ?;
3031- }
3032- if let Some ( ( converted_ty, _, _) ) = arg_ty. fn_argument_converter ( ) {
3033- write ! ( f, "{converted_ty}" ) ?;
3034- } else {
3035- write ! ( f, "{}" , arg_ty. fn_argument( ) ) ?;
3039+
3040+ if let Some ( ( converted_ty, _, _) ) = arg_ty. fn_argument_converter ( ) {
3041+ write ! ( f, "{converted_ty}" ) ?;
3042+ } else {
3043+ write ! ( f, "{}" , arg_ty. fn_argument( ) ) ?;
3044+ }
30363045 }
30373046 write ! ( f, "," ) ?;
30383047 }
0 commit comments