Suggest ref
for some patterns as a fallback
This commit is contained in:
parent
4f7c257fd8
commit
dd72b1a0df
34 changed files with 476 additions and 63 deletions
|
@ -0,0 +1,12 @@
|
|||
// run-rustfix
|
||||
#![allow(unused_variables)]
|
||||
fn main() {
|
||||
struct U;
|
||||
|
||||
// A tuple is a "non-reference pattern".
|
||||
// A `mut` binding pattern resets the binding mode to by-value.
|
||||
|
||||
let mut p = (U, U);
|
||||
let (a, mut b) = &mut p;
|
||||
//~^ ERROR cannot move out of a mutable reference
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue