error[E0505]: cannot move out of `x` because it is borrowed --> test.rs:6:10 | 3 | let y = &x; // borrow a value for reading | -- borrow of `x` occurs here ... 6 | drop(x); | ^ move out of `x` occurs here 7 | 8 | dbg!(y); | - borrow later used here error: aborting due to previous error For more information about this error, try `rustc --explain E0505`.