add compile-fail test sync-cond-shouldnt-escape.rs
This commit is contained in:
parent
604e4add4a
commit
904a74e99c
1 changed files with 9 additions and 0 deletions
9
src/test/compile-fail/sync-cond-shouldnt-escape.rs
Normal file
9
src/test/compile-fail/sync-cond-shouldnt-escape.rs
Normal 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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue