Does this program compile, and what does it print?

from Cell and RefCell
Rust 1.98 intermediate 2 min

Does this program compile, and what does it print?

Rust
use std::cell::RefCell;

fn main() {
    let values = RefCell::new(vec![10, 20]);
    let first = values.borrow()[0];
    values.borrow_mut().push(30);
    println!("{first}: {:?}", values.borrow());
}
Open in playground
Report an error