auto merge of #9285 : sfackler/rust/future, r=alexcrichton
The `Drop` implementation was used to prevent `Future` from being implicitly copyable. Since `~fn`s are no longer copyable, this is no longer needed. I added a cfail test to make sure that this is actually the case. I method-ized all of the `Future` creation methods and added a new one, `spawn_with`, which is similar to `task::spawn_with`. I also got rid of some unused imports in tests.
This commit is contained in:
commit
407d179f4e
9 changed files with 117 additions and 97 deletions
19
src/test/compile-fail/future_not_copyable.rs
Normal file
19
src/test/compile-fail/future_not_copyable.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod extra;
|
||||
|
||||
use extra::future::Future;
|
||||
|
||||
fn main() {
|
||||
let f = Future::from_value(());
|
||||
let g = f;
|
||||
f.unwrap(); //~ ERROR use of moved value
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue