rust/tests/ui/pattern/move-ref-patterns/move-ref-patterns-default-binding-modes-fixable.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
293 B
Rust
Raw Normal View History

// 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
}