Changes to `impl Trait` in Rust 2024
blog.rust-lang.org
blog.rust-lang.org
The implications of this on async seem tremendous. I'm a believer of async, even though it did do quite a bit of damage to the ecosystem, in the long term I bet on it being the correct abstraction (and Rust's implementation being close to the correct implementation). I think this change will make async more convenient and less restrictive to use.
fn indices<T>(
slice: &[T],
) -> impl Iterator<Item = usize> + use<T> {
0 .. slice.len()
}