Instead of having the lifetime on the trait, have it on the function:
trait ReturnIter {
fn return_iter<'a>(&'a self) -> Box<dyn Iterator<Item = usize> + 'a>;
}
Instead of having the lifetime on the trait, have it on the function:
trait ReturnIter {
fn return_iter<'a>(&'a self) -> Box<dyn Iterator<Item = usize> + 'a>;
}