From 871ce9a6c27cc762a09cb8938119a0bd6fdca07e Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 2 Mar 2019 12:22:42 -0800 Subject: [PATCH] fix into_raw_fd impl --- src/pty/unix.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pty/unix.rs b/src/pty/unix.rs index ebe99ba4e..1fa44530d 100644 --- a/src/pty/unix.rs +++ b/src/pty/unix.rs @@ -11,6 +11,7 @@ use std::ptr; pub use std::process::{Child, Command, ExitStatus}; +#[derive(Debug)] pub struct OwnedFd { fd: RawFd, } @@ -47,7 +48,9 @@ impl AsRawFd for OwnedFd { impl IntoRawFd for OwnedFd { fn into_raw_fd(self) -> RawFd { - self.fd + let fd = self.fd; + mem::forget(self); + fd } }