News for hackers. Stuff that matters.
Re:C++ Coroutines Do Not Spark Joy by veber-alex on Monday November 01, 2021 @01:58PM (#29070386)
The only thing new in Rust 2018 is the impl Trait in argument position.

Generics and trait bounds are in the language from the start.

So you can write this function like this:

  fn twiddle<T: IntoIterator<Item = Foozle>>(foozles: T)
Which is 100% idiomatic today and is even preferred by some people over using impl Trait
Re:C++ Coroutines Do Not Spark Joy by slaymaker1907 on Monday November 01, 2021 @04:51PM (#29072942)
impl Trait as the return type actually added quite a bit more than in argument position. In particular, it allows you to return a lambda without boxing since you cannot get the exact return type of a lambda (at least not yet). impl return types are sort of a special case of existential typing.