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 cdd342b commit 9968ccfCopy full SHA for 9968ccf
src/test/run-pass/clone-with-exterior.rs
@@ -8,17 +8,21 @@
8
// option. This file may not be copied, modified, or distributed
9
// except according to those terms.
10
11
-//xfail-test
12
-
13
extern mod std;
+use core::task::spawn;
14
15
-fn f(x : @{a:int, b:int}) {
16
- assert!((x.a == 10));
17
- assert!((x.b == 12));
+struct Pair {
+ a: int,
+ b: int
18
}
19
20
pub fn main() {
21
- let z : @{a:int, b:int} = @{ a : 10, b : 12};
22
- let p = task::_spawn(bind f(z));
23
- task::join_id(p);
+ let z = ~Pair { a : 10, b : 12};
+
+ let f: ~fn() = || {
+ assert!((z.a == 10));
24
+ assert!((z.b == 12));
25
+ };
26
27
+ spawn(f);
28
0 commit comments