You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
new lint: `borrow_deref_ref`
changelog: ``[`borrow_deref_ref`]``
Related pr: rust-lang#6837rust-lang#7577
`@Jarcho` Could you please give a review?
`cargo lintcheck` gives no false negative (but tested crates are out-of-date).
TODO:
1. Not sure the name. `deref_on_immutable_ref` or some others?
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).The text was updated successfully, but these errors were encountered: