From e1ca02ec029014f3982b43635b28a125e3dd8d90 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 20 Mar 2014 18:59:50 -0700 Subject: [PATCH] std: Implement Clone/TotalEq for ProcessExit It's useful for structures which use deriving(Clone, TotalEq), even though it's implicitly copyable. Closes #13047 --- src/libstd/io/process.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index 6afd1bbb27d6..de7b26d5ff4c 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -170,7 +170,7 @@ pub enum StdioContainer { /// Describes the result of a process after it has terminated. /// Note that Windows have no signals, so the result is usually ExitStatus. -#[deriving(Eq)] +#[deriving(Eq, TotalEq, Clone)] pub enum ProcessExit { /// Normal termination with an exit status. ExitStatus(int), @@ -460,6 +460,7 @@ mod tests { assert!(p.is_ok()); let mut p = p.unwrap(); assert!(p.wait().matches_exit_status(1)); + drop(p.wait().clone()); }) #[cfg(unix, not(target_os="android"))]