We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8ac6d4 commit 4e01157Copy full SHA for 4e01157
library/std/src/sys/windows/stdio_uwp.rs
@@ -26,6 +26,7 @@ pub fn get_handle(handle_id: c::DWORD) -> io::Result<c::HANDLE> {
26
27
fn write(handle_id: c::DWORD, data: &[u8]) -> io::Result<usize> {
28
let handle = get_handle(handle_id)?;
29
+ // SAFETY: The handle returned from `get_handle` must be valid and non-null.
30
let handle = unsafe { Handle::from_raw_handle(handle) };
31
ManuallyDrop::new(handle).write(data)
32
}
@@ -39,6 +40,7 @@ impl Stdin {
39
40
impl io::Read for Stdin {
41
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
42
let handle = get_handle(c::STD_INPUT_HANDLE)?;
43
44
45
ManuallyDrop::new(handle).read(buf)
46
0 commit comments