diff --git a/library/std/src/sys/postgres/os.rs b/library/std/src/sys/postgres/os.rs index eb9c12def..fce4da921 100644 --- a/library/std/src/sys/postgres/os.rs +++ b/library/std/src/sys/postgres/os.rs @@ -107,6 +107,23 @@ pub fn current_exe() -> io::Result { pub struct Env(!); +impl Env { + // FIXME(https://github.com/rust-lang/rust/issues/114583): Remove this when ::fmt matches ::fmt. + #[inline] + pub(crate) fn str_debug(&self) -> impl fmt::Debug + '_ { + let Self(inner) = self; + match *inner {} + } +} + +impl fmt::Debug for Env { + #[inline] + fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result { + let Self(inner) = self; + match *inner {} + } +} + impl Iterator for Env { type Item = (OsString, OsString); fn next(&mut self) -> Option<(OsString, OsString)> { diff --git a/library/std/src/sys/postgres/process.rs b/library/std/src/sys/postgres/process.rs index 403ffd20e..c792457dd 100644 --- a/library/std/src/sys/postgres/process.rs +++ b/library/std/src/sys/postgres/process.rs @@ -308,22 +308,6 @@ impl fmt::Debug for Command { } } -impl Clone for ExitStatus { - fn clone(&self) -> ExitStatus { - *self - } -} - -impl Copy for ExitStatus {} - -impl PartialEq for ExitStatus { - fn eq(&self, other: &ExitStatus) -> bool { - self.0 == other.0 - } -} - -impl Eq for ExitStatus {} - #[derive(PartialEq, Eq, Clone, Copy, Debug)] pub struct ExitStatusError(ExitStatus); @@ -386,13 +370,9 @@ impl<'a> fmt::Debug for CommandArgs<'a> { f.debug_list().finish() } } -pub struct ExitStatus(c_int); -impl fmt::Debug for ExitStatus { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_tuple("unix_wait_status").field(&self.0).finish() - } -} +#[derive(PartialEq, Eq, Clone, Copy, Debug, Default)] +pub struct ExitStatus(c_int); impl ExitStatus { pub fn new(status: c_int) -> ExitStatus {