From 33c71ac87d4c4bad82dfd646d7a9254c6b358a26 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Wed, 25 Aug 2021 11:25:26 -0700 Subject: [PATCH 1/2] Add `c_size_t` and `c_ssize_t` to `std::os::raw`. --- library/std/src/os/raw/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/library/std/src/os/raw/mod.rs b/library/std/src/os/raw/mod.rs index 50464a050c7..7ce58fb1d0f 100644 --- a/library/std/src/os/raw/mod.rs +++ b/library/std/src/os/raw/mod.rs @@ -151,3 +151,17 @@ macro_rules! type_alias { #[stable(feature = "raw_os", since = "1.1.0")] #[doc(no_inline)] pub use core::ffi::c_void; + +/// Equivalent to C's `size_t` type, from `stddef.h` (or `cstddef` for C++). +/// +/// This type is currently always [`usize`], however in the future there may be +/// platforms where this is not the case. +#[unstable(feature = "c_size_t", issue = "none")] +pub type c_size_t = usize; + +/// Equivalent to C's `ssize_t` type, from `stddef.h` (or `cstddef` for C++). +/// +/// This type is currently always [`isize`], however in the future there may be +/// platforms where this is not the case. +#[unstable(feature = "c_size_t", issue = "none")] +pub type c_ssize_t = isize; From 5b25de58d6cbfab4fefe3200de8864ab8f6a71d1 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Wed, 25 Aug 2021 14:58:17 -0700 Subject: [PATCH 2/2] Reference tracking issue --- library/std/src/os/raw/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/os/raw/mod.rs b/library/std/src/os/raw/mod.rs index 7ce58fb1d0f..1e220ea30ab 100644 --- a/library/std/src/os/raw/mod.rs +++ b/library/std/src/os/raw/mod.rs @@ -156,12 +156,12 @@ macro_rules! type_alias { /// /// This type is currently always [`usize`], however in the future there may be /// platforms where this is not the case. -#[unstable(feature = "c_size_t", issue = "none")] +#[unstable(feature = "c_size_t", issue = "88345")] pub type c_size_t = usize; /// Equivalent to C's `ssize_t` type, from `stddef.h` (or `cstddef` for C++). /// /// This type is currently always [`isize`], however in the future there may be /// platforms where this is not the case. -#[unstable(feature = "c_size_t", issue = "none")] +#[unstable(feature = "c_size_t", issue = "88345")] pub type c_ssize_t = isize;