about summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-19 18:40:30 +0000
committerbors <bors@rust-lang.org>2024-09-19 18:40:30 +0000
commit506f22b4663f3e756e1e6a4f66c6309fdc00819c (patch)
tree2ede3a1d9428ea22383418f198f68dd24f8e7959 /library/std/src/sys
parent749f80ab051aa0b3724b464130440b0e70a975ac (diff)
parentf715815bfbae2541b0178e567716ed812690f4bd (diff)
downloadrust-506f22b4663f3e756e1e6a4f66c6309fdc00819c.tar.gz
rust-506f22b4663f3e756e1e6a4f66c6309fdc00819c.zip
Auto merge of #130572 - matthiaskrgr:rollup-0q3qyg9, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #128001 (Improve documentation for <integer>::from_str_radix)
 - #130553 ([Clippy] Get rid of most `std` `match_def_path` usage, swap to diagnostic items.)
 - #130554 (`pal::unsupported::process::ExitCode`: use an `u8` instead of a `bool`)
 - #130556 (Mark the `link_cfg` feature as internal)
 - #130558 (Support 128-bit atomics on s390x)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/pal/unsupported/process.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/library/std/src/sys/pal/unsupported/process.rs b/library/std/src/sys/pal/unsupported/process.rs
index 40231bfc90b..fee81744f09 100644
--- a/library/std/src/sys/pal/unsupported/process.rs
+++ b/library/std/src/sys/pal/unsupported/process.rs
@@ -255,11 +255,11 @@ impl ExitStatusError {
 }
 
 #[derive(PartialEq, Eq, Clone, Copy, Debug)]
-pub struct ExitCode(bool);
+pub struct ExitCode(u8);
 
 impl ExitCode {
-    pub const SUCCESS: ExitCode = ExitCode(false);
-    pub const FAILURE: ExitCode = ExitCode(true);
+    pub const SUCCESS: ExitCode = ExitCode(0);
+    pub const FAILURE: ExitCode = ExitCode(1);
 
     pub fn as_i32(&self) -> i32 {
         self.0 as i32
@@ -268,10 +268,7 @@ impl ExitCode {
 
 impl From<u8> for ExitCode {
     fn from(code: u8) -> Self {
-        match code {
-            0 => Self::SUCCESS,
-            1..=255 => Self::FAILURE,
-        }
+        Self(code)
     }
 }