struct Abc {
a: i32,
}
fn main() {
let mut abc = Abc { a: 30 };
let xyz = &abc;
let q = *xyz;
}
Compiling the code gives following error:
error[E0507]: cannot move out of borrowed content
--> src/main.rs:11:13
|
11 | let q = *xyz;
| ^^^^
| |
| cannot move out of borrowed content
| help: consider using a reference instead: `&*xyz`
Please help me understand what is going wrong here.