Closed
Description
rusti> struct A { a: int }
rusti> let foo = A { a: 1 };
rusti> let A { a } = foo;
rusti> a
1
rusti> let A { ref a } = foo;
<anon>:2:6: 2:7 error: found `ref` in ident position
<anon>:2 let A { ref a } = foo;
^
<anon>:2:11: 2:12 error: expected `,` but found `a`
<anon>:2 let A { ref a } = foo;
^
rust: task failed at 'explicit failure', /home/huon/rust/src/libsyntax/diagnostic.rs:70
rusti> let A { ref mut a } = foo;
<anon>:2:6: 2:7 error: found `ref` in ident position
<anon>:2 let A { ref mut a } = foo;
^
<anon>:2:11: 2:14 error: expected `,` but found `mut`
<anon>:2 let A { ref mut a } = foo;
^~~
rust: task failed at 'explicit failure', /home/huon/rust/src/libsyntax/diagnostic.rs:70
These should be equivalent to, e.g., let A { a: ref mut a } = foo;
which works fine (although not in rusti, because of its limitations).