]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/borrow-for-loop-head.rs
Rollup merge of #59432 - phansch:compiletest_docs, r=alexcrichton
[rust.git] / src / test / ui / suggestions / borrow-for-loop-head.rs
1 fn main() {
2     let a = vec![1, 2, 3];
3     for i in &a {
4         for j in a {
5         //~^ ERROR cannot move out of `a` because it is borrowed
6         //~| ERROR use of moved value: `a`
7             println!("{} * {} = {}", i, j, i * j);
8         }
9     }
10 }