Cyclic reference of RefCell borrows in traversal
问题 I'm learning Rust and tried coding a doubly-linked list. However, I'm stuck already at a typical iterative traversal implementation. I'm getting the impression that the borrow checker / drop checker is too strict and cannot infer the correct lifetime for the borrow when it crosses the function boundary from RefCell . I need to repeatedly set a variable binding ( curr in this case) to the borrow of its current contents: use std::cell::RefCell; use std::rc::Rc; pub struct LinkedList<T> { head: