about summary refs log tree commit diff
path: root/library/std/src/process.rs
diff options
context:
space:
mode:
authorAron Parker <hl3mukkel@gmail.com>2022-06-09 15:29:58 +0200
committerAron Parker <hl3mukkel@gmail.com>2022-06-09 15:32:01 +0200
commit0503bc0149d310cf8d07bbb793687eda5ac2ce72 (patch)
tree8f61b73b8124656e7a6d9618e7f5caab01010c5e /library/std/src/process.rs
parent6dc598a01b8f7619826b7152be5162e6d37a1754 (diff)
downloadrust-0503bc0149d310cf8d07bbb793687eda5ac2ce72.tar.gz
rust-0503bc0149d310cf8d07bbb793687eda5ac2ce72.zip
Implement ExitCodeExt for Windows
Diffstat (limited to 'library/std/src/process.rs')
-rw-r--r--library/std/src/process.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/library/std/src/process.rs b/library/std/src/process.rs
index 1def9fe0972..903ad01a200 100644
--- a/library/std/src/process.rs
+++ b/library/std/src/process.rs
@@ -1708,6 +1708,10 @@ impl crate::error::Error for ExitStatusError {}
 #[stable(feature = "process_exitcode", since = "1.61.0")]
 pub struct ExitCode(imp::ExitCode);
 
+/// Allows extension traits within `std`.
+#[unstable(feature = "sealed", issue = "none")]
+impl crate::sealed::Sealed for ExitCode {}
+
 #[stable(feature = "process_exitcode", since = "1.61.0")]
 impl ExitCode {
     /// The canonical `ExitCode` for successful termination on this platform.
@@ -1798,6 +1802,18 @@ impl From<u8> for ExitCode {
     }
 }
 
+impl AsInner<imp::ExitCode> for ExitCode {
+    fn as_inner(&self) -> &imp::ExitCode {
+        &self.0
+    }
+}
+
+impl FromInner<imp::ExitCode> for ExitCode {
+    fn from_inner(s: imp::ExitCode) -> ExitCode {
+        ExitCode(s)
+    }
+}
+
 impl Child {
     /// Forces the child process to exit. If the child has already exited, an [`InvalidInput`]
     /// error is returned.