Remove Rc's borrow method to avoid conflicts with RefCell's borrow in Rc<RefCell<T>>.

This commit is contained in:
Eduard Burtescu 2014-02-28 00:02:27 +02:00
parent 12b2607572
commit cdc18b96d6
28 changed files with 59 additions and 76 deletions

View file

@ -40,7 +40,7 @@ fn main()
//~^ ERROR cannot pack type `~B`, which does not fulfill `Send`
let v = Rc::new(RefCell::new(a));
let w = v.clone();
let b = v.borrow();
let b = v.deref();
let mut b = b.borrow_mut();
b.get().v.set(w.clone());
}

View file

@ -20,5 +20,5 @@ pub fn main() {
let mut x = Rc::new(3);
x = x;
assert!(*x.borrow() == 3);
assert!(*x.deref() == 3);
}