rust/library/std/src
Yuki Okushi ec2fd8a35f
Rollup merge of #93445 - yaahc:exitcode-constructor, r=dtolnay
Add From<u8> for ExitCode

This should cover a mostly cross-platform subset of supported exit codes.

We decided to stick with `u8` initially since its the common subset between all platforms that we support (excluding wasm which I think only works with `true` or `false`). Posix is supposed to take i32s, but in practice many unix platforms mask out all but the low 8 bits or in some cases the 8-15th bits. Windows takes a u32 instead of an i32. Bourne-compatible shells also report signals as exitcode 128 + `signal_no`, so there's some ambiguity there when returning exit codes > 127, but it is possible to disambiguate them on the other side so we decided against restricting the possible codes further than to `u8`.

## Related

- Detailed analysis of exit code support on various platforms: https://internals.rust-lang.org/t/mini-pre-rfc-redesigning-process-exitstatus/5426
- https://github.com/rust-lang/rust/issues/48711
- https://github.com/rust-lang/rust/issues/43301
- https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Termination.2FExit.20Status.20Stabilization
2022-02-09 14:12:17 +09:00
..
backtrace Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
collections add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
env
error silence tidy errors 2022-01-07 13:59:27 -08:00
f32 Implement IEEE 754-2019 minimun and maximum functions for f32/f64 2021-11-20 10:14:03 +01:00
f64 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
ffi Auto merge of #87869 - thomcc:skinny-io-error, r=yaahc 2022-02-07 20:32:56 +00:00
fs fs: Add a regression test for #93384 2022-01-29 16:37:21 -05:00
io Add more tests for io::Error packing, and fix some comments that weren't quite accurate anymore 2022-02-04 23:15:02 -08:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
net Hide Repr details from io::Error, and rework io::Error::new_const. 2022-02-04 18:47:29 -08:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Hide Repr details from io::Error, and rework io::Error::new_const. 2022-02-04 18:47:29 -08:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path add benchmarks and tests for Hash and Eq impls on Path 2021-11-09 20:54:00 +01:00
prelude update cfg(bootstrap)s 2022-01-28 15:01:07 +01:00
process Rollup merge of #92208 - ChrisDenton:win-bat-cmd, r=dtolnay 2021-12-23 00:28:56 +01:00
sync update cfg(bootstrap)s 2022-01-28 15:01:07 +01:00
sys Rollup merge of #93445 - yaahc:exitcode-constructor, r=dtolnay 2022-02-09 14:12:17 +09:00
sys_common Hide Repr details from io::Error, and rework io::Error::new_const. 2022-02-04 18:47:29 -08:00
thread Rollup merge of #92555 - m-ou-se:scoped-threads, r=Amanieu 2022-01-23 20:13:02 +01: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
backtrace.rs Change Backtrace::enabled atomic from SeqCst to Relaxed 2021-12-20 12:34:10 -08:00
env.rs Rollup merge of #89999 - talagrand:GetTempPath2, r=m-ou-se 2021-12-09 05:08:31 +01:00
error.rs Improve Duration::try_from_secs_f32/64 accuracy by directly processing exponent and mantissa 2022-01-26 18:14:25 +03: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 #93206 - ChrisDenton:ntopenfile, r=nagisa 2022-02-08 16:40:49 +01:00
keyword_docs.rs eplace usages of vec![].into_iter with [].into_iter 2022-01-09 14:09:25 +11:00
lazy.rs Add #[must_use] to core and std constructors 2021-10-10 02:44:26 -04:00
lib.rs Auto merge of #93146 - workingjubilee:use-std-simd, r=Mark-Simulacrum 2022-02-03 09:15:16 +00:00
macros.rs Add diagnostic items for macros 2022-01-06 14:59:33 +00:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Configure panic hook backtrace behavior 2022-02-02 13:46:42 -05:00
panicking.rs Configure panic hook backtrace behavior 2022-02-02 13:46:42 -05:00
path.rs Link try_exists docs to Path::exists 2022-02-01 18:40:29 +00:00
primitive_docs.rs Fix annotation of code blocks 2022-02-01 21:44:53 +00:00
process.rs Add From<u8> for ExitCode 2022-02-06 12:43:12 -08:00
rt.rs Change Termination::report return type to ExitCode 2022-01-28 12:53:36 -08:00
time.rs Document SystemTime platform precision 2022-01-29 20:41:18 +00:00