add compile-fail test sync-cond-shouldnt-escape.rs

This commit is contained in:
Ben Blum 2012-08-08 19:49:30 -04:00
parent 604e4add4a
commit 904a74e99c

View File

@ -0,0 +1,9 @@
// error-pattern: reference is not valid outside of its lifetime
fn main() {
let m = ~sync::new_mutex();
let mut cond = none;
do m.lock_cond |c| {
cond = some(c);
}
option::unwrap(cond).signal();
}