libextra: Another round of de-Cell-ing.
34 uses of `Cell` remain.
This commit is contained in:
parent
5aad292fb9
commit
786dea207d
35 changed files with 211 additions and 387 deletions
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
use std::cell::Cell;
|
||||
use std::task;
|
||||
|
||||
struct Port<T>(@T);
|
||||
|
|
@ -31,10 +30,10 @@ fn main() {
|
|||
}
|
||||
}
|
||||
|
||||
let x = Cell::new(foo(Port(@())));
|
||||
let x = foo(Port(@()));
|
||||
|
||||
do task::spawn {
|
||||
let y = x.take(); //~ ERROR does not fulfill `Send`
|
||||
let y = x; //~ ERROR does not fulfill `Send`
|
||||
error!("{:?}", y);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
// except according to those terms.
|
||||
|
||||
use std::rc::Rc;
|
||||
use std::cell::Cell;
|
||||
use std::cell::RefCell;
|
||||
|
||||
fn bar<T: Freeze>(_: T) {}
|
||||
|
||||
fn main() {
|
||||
let x = Rc::from_send(Cell::new(5));
|
||||
bar(x); //~ ERROR instantiating a type parameter with an incompatible type `std::rc::Rc<std::cell::Cell<int>>`, which does not fulfill `Freeze`
|
||||
let x = Rc::from_send(RefCell::new(5));
|
||||
bar(x); //~ ERROR instantiating a type parameter with an incompatible type `std::rc::Rc<std::cell::RefCell<int>>`, which does not fulfill `Freeze`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue