use arcshift::{ArcShift, ArcShiftWeak};
use std::cell::RefCell;
fn main() {
#[allow(dead_code)]
struct Node {
parent: Option<ArcShiftWeak<Node>>,
child: RefCell<Option<ArcShift<Node>>>,
}
let mut root = ArcShift::new(Node {
parent: None,
child: RefCell::new(None),
});
let child = ArcShift::new(Node {
parent: Some(ArcShift::downgrade(&root)),
child: RefCell::new(None),
});
root.get().child.borrow_mut().replace(child.clone());
}