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

Clark Gaebel cgaebel at uwaterloo.ca
Wed Jan 29 19:29:37 PST 2014


'let mut' signals a let binding to a mutable variable...?


On Wed, Jan 29, 2014 at 10:26 PM, Samuel Williams <
space.ship.traveller at gmail.com> wrote:

> 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
>>
>
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
>


-- 
Clark.

Key ID     : 0x78099922
Fingerprint: B292 493C 51AE F3AB D016  DD04 E5E3 C36F 5534 F907
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140129/ecd3360d/attachment.html>


More information about the Rust-dev mailing list