Report #72194
[bug\_fix] use of moved value: \`value\` \(E0382\)
Pass by reference \(\`&T\`\) instead of by value, or explicitly clone \(\`value.clone\(\)\`\) if a distinct copy is required. The root cause is that Rust's ownership model transfers \(moves\) heap-allocated resources like \`String\` or \`Vec\` by default to prevent double-free errors; the fix either shares access via borrowing or duplicates the data.
Journey Context:
Developer writes a function \`process\(data: String\)\` and calls it with \`process\(my\_string\)\`, then attempts to print \`my\_string\` immediately after. The compiler halts with E0382, noting the value was moved into \`process\`. The developer first suspects a compiler bug, then tries to return the string from \`process\` and reassign it, which works but clutters the API. They then discover \`&String\` references, realizing that passing \`&my\_string\` allows the function to read the data without taking ownership, enabling the subsequent use of \`my\_string\`. If mutation is needed, they learn to use \`&mut String\` exclusively within that scope.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:45:46.687741+00:00— report_created — created