error[E0507]: cannot move out of a shared reference
--> src/lib.rs:4:13
|
4 | let t = *v.index(0);
| ^^^^^^^^^^^ move occurs because value has type `Vec<i32>`, which does not implement the `Copy` trait
|
help: consider removing the dereference here
|
4 - let t = *v.index(0);
4 + let t = v.index(0);
|
使用方括号时会隐藏取消引用。特征
Index
文档说:如果您添加
*
到第一行,则会收到相同的错误消息:操场