Report #67596
[bug\_fix] E0382: borrow of moved value / use of moved value
Clone the value explicitly with .clone\(\) before the move, or restructure to use references \(&T\) instead of owned values. For example, change vec.push\(item\) followed by println\!\("\{\}", item\) to vec.push\(item.clone\(\)\) or store references if the data lives long enough.
Journey Context:
Developer is building a configuration parser that reads a file, extracts a String field \(like a database URL\), pushes it into a Vec for validation, and then attempts to log the original string for debugging. The compiler halts with "value used here after move". The developer initially suspects a bug in the Vec implementation, then learns that String does not implement the Copy trait—unlike i32 or bool—meaning ownership transfers \(moves\) to the Vec, leaving the original binding invalid. After consulting the error code documentation, they understand that Rust's ownership model prevents use-after-move bugs at compile time. The fix works because .clone\(\) creates a deep copy of the String's heap data, giving the Vec its own independent copy while preserving the original for the log statement.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T19:56:21.529626+00:00— report_created — created