We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 604e4ad commit 904a74eCopy full SHA for 904a74e
src/test/compile-fail/sync-cond-shouldnt-escape.rs
@@ -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