rust/tests/compile-fail/fs/write_to_stdin.rs
Samrat Man Singh bdef57ea45 Flush to stdout from FileDescriptor::write for Stdout
Also, remove unnecessary `-Zmiri-disable-isolation` in test
2020-08-04 20:40:48 +05:30

14 lines
278 B
Rust

// ignore-windows: No libc on Windows
#![feature(rustc_private)]
extern crate libc;
fn main() -> std::io::Result<()> {
let bytes = b"hello";
unsafe {
libc::write(0, bytes.as_ptr() as *const libc::c_void, 5); //~ ERROR cannot write to stdin
}
Ok(())
}