How to move a Vec<Box<dyn Trait>> Into Vec<Rc<RefCell<dyn Trait>>>
问题 I have a Vec<Box<dyn Trait>> as input, and I want to store its elements in a Vec<Rc<RefCell<dyn Trait>>> . What is the best way to do it? I tried with: use std::cell::RefCell; use std::rc::Rc; trait Trait {} fn main() { let mut source: Vec<Box<dyn Trait>> = Vec::new(); let mut dest: Vec<Rc<RefCell<dyn Trait>>> = Vec::new(); for s in source { let d = Rc::new(RefCell::new(s.as_ref())); dest.push(d); } } But I got the error: error[E0277]: the trait bound `&dyn Trait: Trait` is not satisfied -->