]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2005-default-binding-mode/for.rs
Rollup merge of #60176 - matthewjasper:yield-ref-to-local, r=pnkfelix
[rust.git] / src / test / ui / rfc-2005-default-binding-mode / for.rs
1 struct Foo {}
2
3 pub fn main() {
4     let mut tups = vec![(Foo{}, Foo{})];
5     // The below desugars to &(ref n, mut m).
6     for (n, mut m) in &tups {
7         //~^ ERROR cannot bind by-move and by-ref in the same pattern
8         //~| ERROR cannot move out of borrowed content
9     }
10 }