- | - ^^^^^^^^ cannot move out of borrowed content
- | |
- | data moved here
- | help: to prevent move, use ref or ref mut: `ref a`
+ | -- ^^^^^^^^ cannot move out of borrowed content
+ | ||
+ | |data moved here
+ | help: consider removing the `&`: `a`
+ |
+note: move occurs because `a` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
+ --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:10
+ |
+LL | for &a in x.iter() { //~ ERROR cannot move out
+ | ^