[rust-dev] "let mut" <-> "var"

Samuel Williams space.ship.traveller at gmail.com
Wed Jan 29 19:26:54 PST 2014


Interesting - so if there is no difference, what is the point of "let mut" ?


On 30 January 2014 16:21, Patrick Walton <pcwalton at mozilla.com> wrote:

> On 1/29/14 7:20 PM, Samuel Williams wrote:
>
>> What about constant folding? Surely let mut x = 10 is easier for the
>> compiler to optimise?
>>
>
> In less advanced compilers, that may be true. But Rust internally converts
> everything to SSA, so there is no difference.
>
> Patrick
>
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140130/4858fe28/attachment.html>


More information about the Rust-dev mailing list