blob: 5c51c47d9798a1514e9eb27c21783595ac91b4a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#![feature(move_ref_pattern)]
fn main() {
struct U;
// A tuple is a "non-reference pattern".
// A `mut` binding pattern resets the binding mode to by-value.
let p = (U, U);
let (a, mut b) = &p;
//~^ ERROR cannot move out of a shared reference
let mut p = (U, U);
let (a, mut b) = &mut p;
//~^ ERROR cannot move out of a mutable reference
}
|