27 ms·
Unsure if I misunderstand: Index returns a reference: https://doc.rust-lang.org/std/ops/trait.Index.html#:~:text=self%2C%20index:%20Idx)%20%2D%3E-,&Self::Outp
by OptionOfT 10mo ago
Unsure if I misunderstand:
Index returns a reference:
https://doc.rust-lang.org/std/ops/trait.Index.html#:~:text=self%2C%20index:%20Idx)%20%2D%3E-,&Self::Output https://doc.rust-lang.org/std/ops/trait.Index.html#:~:text=s...
If you don't use the reference it just ... disappears.
Am I missing something here?
- junon 10mo agoTechnically without any optimizations this would result in a stray LEA op or something but any optimizing compiler (certainly any that support Rust) would optimize it out even at low levels of debug settings.