>>> Miss it? Did it ever work? This seems like a bug though. Mutability is
>>> inherited, so without this there's no way to do mutable destructuring
>>> bind right?
>> Apparently it went away in commit f9b54541 and the workaround used there
>> is `let (foo, bar) = ...; let mut foo = foo;` etc.
>>
>> Seems intentional, but I don't recall the rationale.
>
> The eventual plan is to say `let (mut foo, bar) = ...;`. We just don't yet 
> support that.

The commit's intention as i recall was to change this `let mut foo,
bar;` which would make bar mutable. I'm not sure the intent was to
affect destructuring bind.

While `let (mut foo, bar)` matches pattern syntax for tuples, it seems
weird for structs, although I guess it probably matches there too.

`let mut Foo { x: x, y: y } = some_foo;` seems better than `let Foo {
mut x: x, mut y: y} = some_foo;`. Seems like both are probably
reasonable to have.

I don't feel super strongly about this, I just thought it weird that
destructuring let doesn't work with mut in the obvious (to me anyway)
way.

jack.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to