rust/src/test/ui/rfc-2005-default-binding-mode/for.rs
Mazdak Farrokhzad d984f127f6 move_ref_patterns: introduce tests
bindings_after_at: harden tests
2020-02-02 14:13:07 +01:00

12 lines
246 B
Rust

#![feature(move_ref_pattern)]
struct Foo {}
pub fn main() {
let mut tups = vec![(Foo {}, Foo {})];
// The below desugars to &(ref n, mut m).
for (n, mut m) in &tups {
//~^ ERROR cannot move out of a shared reference
}
}