Handle’s std::os::unix::io::IntoRawFd implementation panics on stdin/stdout/stderr
chris-morgan opened this issue · 1 comments
chris-morgan commented
This panics:
std::os::unix::io::IntoRawFd::into_raw_fd(same_file::Handle::stdin().unwrap())
The Option<File>
field is treated carelessly, and so the reassuring “unwrapping won’t panic” comment in the Drop
implementation is wrong.
Really, Option
is the wrong tool to use here; it should be ManuallyDrop
these days (✓ available within the current MSRV).
chris-morgan commented
(I found this as part of a detailed review.)