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