Skip to content

Commit 904a74e

Browse files
committed
add compile-fail test sync-cond-shouldnt-escape.rs
1 parent 604e4ad commit 904a74e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// error-pattern: reference is not valid outside of its lifetime
2+
fn main() {
3+
let m = ~sync::new_mutex();
4+
let mut cond = none;
5+
do m.lock_cond |c| {
6+
cond = some(c);
7+
}
8+
option::unwrap(cond).signal();
9+
}

0 commit comments

Comments
 (0)