Consider such code:
trait Foo { fn foo(&self); } fn consume_func(b: Box>) { unimplemented!(); } fn produce_func() -> Box<
Although you've stated you cannot change consume_func, others with similar issues can change it to accept a generic:
consume_func
fn consume_func(b: Box>) { unimplemented!(); }