diff --git a/library/std/src/sys/unix/fd.rs b/library/std/src/sys/unix/fd.rs index e36a53084ba..ba169b251b0 100644 --- a/library/std/src/sys/unix/fd.rs +++ b/library/std/src/sys/unix/fd.rs @@ -283,12 +283,12 @@ impl Drop for FileDesc { #[cfg(test)] mod tests { use super::{FileDesc, IoSlice}; + use core::mem::ManuallyDrop; #[test] fn limit_vector_count() { - let stdout = FileDesc { fd: 1 }; + let stdout = ManuallyDrop::new(FileDesc { fd: 1 }); let bufs = (0..1500).map(|_| IoSlice::new(&[])).collect::>(); - assert!(stdout.write_vectored(&bufs).is_ok()); } }