We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 343e1dc commit f0356d1Copy full SHA for f0356d1
[refs]
@@ -1,2 +1,2 @@
1
---
2
-refs/heads/master: 21cc0c6e69322a8ae3221d18bf8b3fbbdd5fd1f7
+refs/heads/master: 4465c1ad022740eb9204f3111396be6b16351632
trunk/src/test/run-pass/sendfn-spawn-with-fn-arg.rs
@@ -0,0 +1,20 @@
+use std;
+
3
+import std::comm;
4
+import std::comm::chan;
5
+import std::comm::send;
6
7
+fn main() { test05(); }
8
9
+fn test05_start(&&f: sendfn(int)) {
10
+ f(22);
11
+}
12
13
+fn test05() {
14
+ let three = ~3;
15
+ let fn_to_send = sendfn(n: int) {
16
+ log_err *three + n; // will copy x into the closure
17
+ assert(*three == 3);
18
+ };
19
+ task::spawn(fn_to_send, test05_start);
20
0 commit comments