rust/tests/compile-fail/chdir_invalid_path.rs
2019-09-24 17:28:38 -05:00

12 lines
281 B
Rust

// compile-flags: -Zmiri-disable-isolation
extern {
pub fn chdir(dir: *const u8) -> i32;
}
fn main() {
let path = vec![0xc3u8, 0x28, 0];
// test that `chdir` errors with invalid utf-8 path
unsafe { chdir(path.as_ptr()) }; //~ ERROR is not a valid utf-8 string
}