Error code E0009
Note: this error code is no longer emitted by the compiler.
In a pattern, all values that don't implement the Copy
trait have to be bound
the same way. The goal here is to avoid binding simultaneously by-move and
by-ref.
This limitation may be removed in a future version of Rust.
Erroneous code example:
You have two solutions:
Solution #1: Bind the pattern's values the same way.
Solution #2: Implement the Copy
trait for the X
structure.
However, please keep in mind that the first solution should be preferred.