Links: Rust Blog , Impl Trait Initiative , Rust Compiler Development Guide , Rust RFC Book , Youtube Shorts , HackMD.io
https://www.youtube.com/watch?v=CWiz_RtA1Hw
[https://docs.google.com/presentation/d/1U27Yr8MniRMUfxfPlwYt3wkYm6EtTWv42slYGRdgW1M/edit#slide=id.p](https://docs.google.com/presentation/d/1U27Yr8MniRMUfxfPlwYt3wkYm6EtTWv42slYGRdgW1M/preview#slide=id.p)
https://hackmd.io/@rust-lang-team/Sk8bgypVh#Key-highlights-of-the-design-in-the-RFC
Let's break down and compare the two function signatures:
fn f1() -> std::vec::IntoIter<u32> {
/*...*/
}
fn f2() -> impl Iterator<Item = u32> {
/*...*/
}
f1 Functionfn f1() -> std::vec::IntoIter<u32> {
/*...*/
}
f1 returns a std::vec::IntoIter<u32>.std::vec::IntoIter<u32>: This type is a concrete type representing the iterator produced by consuming a Vec<u32>. When you call into_iter() on a vector, you get an IntoIter that yields elements of type u32.f2 Return Position Impl Trait (RPIT)