rust/tests/compile-fail/sync/libc_pthread_rwlock_unlock_unlocked.rs

13 lines
267 B
Rust
Raw Normal View History

2020-04-05 14:55:57 -05:00
// ignore-windows: No libc on Windows
#![feature(rustc_private)]
extern crate libc;
fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
libc::pthread_rwlock_unlock(rw.get()); //~ ERROR was not locked
}
}