fn panic_to_error<S: Schedule>( scheduler: &S, task_id: Id, panic: Box<dyn Any + Send + 'static>, ) -> JoinError