// build-pass (FIXME(62277): could be check-pass?) use std::cell::RefCell; use std::rc::Rc; pub struct Callbacks { callbacks: Vec>>, } impl Callbacks { pub fn register(&mut self, callback: F) { self.callbacks.push(Rc::new(RefCell::new(callback))); } } fn main() {}