File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,11 @@ export future_pipe;
33
33
34
34
#[ doc = "The future type" ]
35
35
struct Future < A > {
36
- /*priv*/ mut state : FutureState < A > ,
36
+ /*priv*/ mut state : FutureState < A > ;
37
+
38
+ // FIXME(#2829) -- futures should not be copyable, because they close
39
+ // over fn~'s that have pipes and so forth within!
40
+ drop { }
37
41
}
38
42
39
43
priv enum FutureState <A > {
@@ -88,7 +92,7 @@ fn from_port<A:Send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
88
92
port_ <-> * port;
89
93
let port = option:: unwrap ( port_) ;
90
94
match recv ( port) {
91
- future_pipe:: completed( move data) => data
95
+ future_pipe:: completed( move data) => data
92
96
}
93
97
}
94
98
}
Original file line number Diff line number Diff line change @@ -415,13 +415,13 @@ mod tests {
415
415
416
416
for uint:: range( 0 u, num_tasks) |_i| {
417
417
let total = total. clone ( ) ;
418
- futures += ~ [ future:: spawn ( || {
418
+ vec :: push ( futures, future:: spawn ( || {
419
419
for uint:: range( 0 u, count) |_i| {
420
420
do total. with |count| {
421
421
* * count += 1 u;
422
422
}
423
423
}
424
- } ) ] ;
424
+ } ) ) ;
425
425
} ;
426
426
427
427
for futures. each |f| { f. get ( ) }
You can’t perform that action at this time.
0 commit comments