Changes to `impl Trait` in Rust 2024(blog.rust-lang.org)
blog.rust-lang.org
Changes to `impl Trait` in Rust 2024
https://blog.rust-lang.org/2024/09/05/impl-trait-capture-rules.html
3 comments
Big kudos to Rust compiler devs about their sophisticated type system and its kind (and highly intelligent) help messages. A little concern is that AFAIK its complexity in type systems and other static analysis things require deep domain knowledge, so in a far, far future there may be a lack of "core" engineers comparing to a demand much increased at that point. This kind of change looks like already requiring deep understanding of both Rust's type system and internal compiler structure to implement.
Rust as a language has a complexity threshold already exceeding C++ in readability within a decade of existence. Adding things like + `use<T>` at the end of an already complex return type doesn't really help matters.
fn indices<T>(
slice: &[T],
) -> impl Iterator<Item = usize> + use<T> {
0 .. slice.len()
}
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.