]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/chdir_invalid_path.rs
22b0d723aad8c8c7ff13434929db5029a6f63508
[rust.git] / tests / compile-fail / chdir_invalid_path.rs
1 // compile-flags: -Zmiri-disable-isolation
2
3 extern {
4     pub fn chdir(dir: *const u8) -> i32;
5 }
6
7 fn main() {
8     let path = vec![0xc3u8, 0x28, 0];
9     // test that `chdir` errors with invalid utf-8 path
10     unsafe { chdir(path.as_ptr()) };  //~ ERROR is not a valid utf-8 string
11 }