rust/library/std/src
bors 87ec5680c9 Auto merge of #90421 - thomcc:friendship-ended-with-ssize_t-now-ptrdiff_t-is-my-best-friend, r=joshtriplett
Replace `std::os::raw::c_ssize_t` with `std::os::raw::c_ptrdiff_t`

The discussions in #88345 brought up that `ssize_t` is not actually the signed index type defined in stddef.h, but instead it's `ptrdiff_t`. It seems pretty clear that the use of `ssize_t` here was a mistake on my part, and that if we're going to bother having a isize-alike for FFI in `std::os::raw`, it should be `ptrdiff_t` and not `ssize_t`.

Anyway, both this and `c_size_t` are dubious in the face of the discussion in https://internals.rust-lang.org/t/pre-rfc-usize-is-not-size-t/15369, and any RFC/project-group/etc that handles those issues there should contend with these types in some manner, but that doesn't mean we shouldn't fix something wrong like this, even if it is unstable.

All that said, `size_t` is *vastly* more common in function signatures than either `ssize_t` or `ptrdiff_t`, so I'm going to update the tracking issue's list of unresolved questions to note that perhaps we only want `c_size_t` — I mostly added the signed version for symmetry, rather than to meet a need. (Given this, I'm also fine with modifying this patch to instead remove `c_ssize_t` without a replacement)

CC `@magicant` (who brought the issue up)
CC `@chorman0773` (who has a significantly firmer grasp on the minutae of the C standard than I do)

r? `@joshtriplett` (original reviewer, active in the discussions around this)
2021-11-03 05:36:30 +00:00
..
backtrace Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
collections Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f32 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
f64 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
ffi Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
fs Make sure CreateDirectoryW works for path lengths > 247 2021-10-23 19:35:24 +01:00
io Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
net Add #[must_use] to remaining std functions (A-N) 2021-10-30 23:44:02 -04:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Auto merge of #90421 - thomcc:friendship-ended-with-ssize_t-now-ptrdiff_t-is-my-best-friend, r=joshtriplett 2021-11-03 05:36:30 +00:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path Ensure that pushing empty path works as before 2021-10-14 08:59:28 +01:00
prelude Move asm! and global_asm! to core::arch 2021-07-18 18:30:58 -04:00
process Test that env_clear works on Windows 2021-06-24 09:32:24 +01:00
sync Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
sys Run destructors from existing tls callback 2021-11-01 15:19:49 +00:00
sys_common Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
thread Auto merge of #90439 - m-ou-se:thread-is-running, r=Mark-Simulacrum 2021-11-02 08:11:57 +00:00
time Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
alloc.rs Rename rterr to rtprintpanic 2021-05-19 15:52:09 +02:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs Add #[must_use] to remaining std functions (A-N) 2021-10-30 23:44:02 -04:00
env.rs Add #[must_use] to remaining std functions (A-N) 2021-10-30 23:44:02 -04:00
error.rs Stabilize try_reserve 2021-10-04 10:29:46 +01:00
f32.rs Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
f64.rs Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
fs.rs Rollup merge of #90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett 2021-10-31 13:20:06 +01:00
keyword_docs.rs Fix typo in break docs 2021-09-16 14:51:14 +03:00
lazy.rs Add #[must_use] to core and std constructors 2021-10-10 02:44:26 -04:00
lib.rs Auto merge of #90273 - nbdd0121:const, r=fee1-dead 2021-10-27 15:32:42 +00:00
macros.rs bump bootstrap compiler to 1.55 2021-08-01 11:19:24 -04:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Deduplicate panic_fmt 2021-10-19 15:02:21 +01:00
panicking.rs Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
path.rs Rollup merge of #90431 - jkugelman:must-use-std-o-through-z, r=joshtriplett 2021-10-31 13:20:07 +01:00
primitive_docs.rs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
process.rs Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
rt.rs Rollup merge of #89068 - bjorn3:restructure_rt2, r=joshtriplett 2021-10-31 13:20:04 +01:00
time.rs Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00