The resulting machine code is seriously impressive! One thing that I’d be interested to see is the LLVM IR that the Rust compiler itself produces; it’s unclear to me how much of the handiwork is Rust’s, and how much is LLVM’s.
In general, for now the answer is “mostly LLVM’s”, but is slowly changing over to more inside rustc. MIR in particular will allow us to start doing some of our own optimization passes.
I plugged their example into the Rust Playground and it looks like the iterators get unrolled before it is turned into LLVM IR.