Not necessarily a static inference... could be speculative.
Code folding golf is a bit of a hobby of mine. For example you can optimise through the string-integer conversion by storing a special string that remembers it was originally an integer and returning that value again instead of re-parsing. I work on a compiler that does that one for real, for example.
I don't seriously think Rust does this right now, but would be a challenge to try.
Not necessarily a static inference... could be speculative.
Code folding golf is a bit of a hobby of mine. For example you can optimise through the string-integer conversion by storing a special string that remembers it was originally an integer and returning that value again instead of re-parsing. I work on a compiler that does that one for real, for example.
I don't seriously think Rust does this right now, but would be a challenge to try.