Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRustRc<RefCell<T>> combosSingle-choice MCQ

What does this program print, given the shared `Rc<RefCell<Vec<i32>>>` mutated through two clones?

use std::rc::Rc; use std::cell::RefCell; fn main() { let a = Rc::new(RefCell::new(vec![1])); let b = Rc::clone(&a); b.borrow_mut().push(2); println!("{:?}", a.borrow()); }