2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of a shared reference
|
2022-12-08 19:14:56 -06:00
|
|
|
--> $DIR/issue-51415.rs:7:42
|
2018-06-21 13:32:52 -05:00
|
|
|
|
|
|
|
|
LL | let opt = a.iter().enumerate().find(|(_, &s)| {
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^-^
|
2019-05-05 06:02:32 -05:00
|
|
|
| |
|
|
|
|
| data moved here
|
2020-09-02 02:40:56 -05:00
|
|
|
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
|
2022-12-08 19:14:56 -06:00
|
|
|
|
|
|
|
|
help: consider borrowing the pattern binding
|
|
|
|
|
|
|
|
|
LL | let opt = a.iter().enumerate().find(|(_, &ref s)| {
|
|
|
|
| +++
|
2018-06-21 13:32:52 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0507`.
|