Map `int` to `core::ffi::c_int` (also for most other builtin C++ types).
This CL provides mappings for most types under `core::ffi`, except for:
* Types like `core::ffi::ptrdiff_t`, because they depend on an
experimental feature: https://github.com/rust-lang/rust/issues/88345
* `core::ffi::c_char` because of b/276931370 and because continuing
translating `char` to `u8` reduces the amount of cascading changes in
this CL (e.g. changes to `crubit/support/cc_std/string_view.rs`).
Note that some other `clang/AST/BuiltinTypes.def` types like `char16_t`
don't have an equivelent under `core::ffi`. This CL doesn't change how
such types are handled (some of them are already covered by
`rs_bindings_from_cc/type_map.cc`).
PiperOrigin-RevId: 533279988
diff --git a/rs_bindings_from_cc/test/golden/friend_functions_rs_api.rs b/rs_bindings_from_cc/test/golden/friend_functions_rs_api.rs
index 699a941..005ca17 100644
--- a/rs_bindings_from_cc/test/golden/friend_functions_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/friend_functions_rs_api.rs
@@ -93,7 +93,7 @@
/// Uint128Low64 declarations from absl/numeric/int128.h. This is a
/// regression test for b/244311755.
#[inline(always)]
-pub fn multiple_declarations<'a>(__param_0: &'a crate::SomeClass) -> i32 {
+pub fn multiple_declarations<'a>(__param_0: &'a crate::SomeClass) -> ::core::ffi::c_int {
unsafe { crate::detail::__rust_thunk___Z21multiple_declarationsRK9SomeClass(__param_0) }
}
@@ -133,7 +133,7 @@
);
pub(crate) fn __rust_thunk___Z21multiple_declarationsRK9SomeClass<'a>(
__param_0: &'a crate::SomeClass,
- ) -> i32;
+ ) -> ::core::ffi::c_int;
}
}