What your parent is saying is that the compiler treats that loop as
{
let result = match IntoIterator::into_iter(1..10) {
mut iter => loop {
let next;
match iter.next() {
Some(val) => next = val,
None => break,
};
let i = next;
let () = { println!("{i}"); };
},
};
result
}
(95% sure I got that correct)
And so in some sense, "loop" is more primitive than "for".
> But then hypothetically the assembly output could… end up not even having a loop at all
Absolutely, with any of these loops, the compiler may not emit a loop in assembly. And in this case, that seems to be true: https://godbolt.org/z/7Gq69Gvre