use std::any::Any; fn foo(value: &T) -> Box { Box::new(value) as Box //~^ ERROR cannot infer an appropriate lifetime } fn main() { let _ = foo(&5); }