On Sep 25, 2013, at 2:58 PM, Jack Moffitt <j...@metajack.im> wrote: >>>> 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.
I believe the intention was to allow `mut` in the same places you could put `ref` today in a pattern match. -Kevin _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev