Really strange output difference between 2 loops
⚓ Rust 📅 2026-05-25 👤 surdeus 👁️ 1Hi,
I was trying a useless piece of code to see the difference between the treatment of ranges, either inclusive or exclusive.
Godbolt test
(I lazily reused the default function names, "square").
The assembly difference looks really strange to me. The code does the exact same useless thing, but the assembly efficiency varies a lot.
I don't care if it's not measurable in real life, I focus on the output and don't understand why it's so different.
Is it a stabilization issue?
Thanks guys!
1 post - 1 participant
🏷️ Rust_feed