Skip to content

Commit 0783061

Browse files
committed
Adding a test to make sure CCI works with capture clauses.
1 parent f49b891 commit 0783061

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export foo;
2+
3+
import comm::*;
4+
5+
fn foo<T: send copy>(x: T) -> port<T> {
6+
let p = port();
7+
let c = chan(p);
8+
task::spawn() {|copy c, copy x|
9+
c.send(x);
10+
}
11+
p
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// aux-build:cci_capture_clause.rs
2+
3+
// This test makes sure we can do cross-crate inlining on functions
4+
// that use capture clauses.
5+
6+
use cci_capture_clause;
7+
8+
import comm::recv;
9+
import comm::methods;
10+
11+
fn main() {
12+
cci_capture_clause::foo(()).recv()
13+
}

0 commit comments

Comments
 (0)