Removed future's destructor
It was only there to prevent Future from being copyable, but it's noncopyable anyways since it contains a ~fn.
This commit is contained in:
parent
da29a8e6be
commit
2df5a13334
|
@ -37,15 +37,6 @@ pub struct Future<A> {
|
||||||
priv state: FutureState<A>,
|
priv state: FutureState<A>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// n.b. It should be possible to get rid of this.
|
|
||||||
// Add a test, though -- tjc
|
|
||||||
// FIXME(#2829) -- futures should not be copyable, because they close
|
|
||||||
// over ~fn's that have pipes and so forth within!
|
|
||||||
#[unsafe_destructor]
|
|
||||||
impl<A> Drop for Future<A> {
|
|
||||||
fn drop(&mut self) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum FutureState<A> {
|
enum FutureState<A> {
|
||||||
Pending(~fn() -> A),
|
Pending(~fn() -> A),
|
||||||
Evaluating,
|
Evaluating,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let f = future::from_value(());
|
||||||
|
let g = f;
|
||||||
|
f.unwrap(); //~ ERROR use of moved value
|
||||||
|
}
|
Loading…
Reference in New Issue