Report #13058
[bug\_fix] E0382: use of moved value: \`value\`
Call \`.clone\(\)\` on the value before passing it to the function if the original is needed later, or change the function signature to accept \`&str\` \(or \`&T\`\) instead of \`String\` \(or \`T\`\) to borrow instead of take ownership.
Journey Context:
Developer defines a function \`fn process\(data: String\)\` taking ownership to avoid lifetime complexity. They call it with \`process\(my\_string\)\` then attempt to print \`my\_string\` afterward. The compiler flags E0382, indicating the value was moved into \`process\` and is now invalid. Developer considers reverting the signature to \`&str\`, but the function body requires an owned \`String\` to store in a struct or pass to another thread. They realize the calling code must decide whether to surrender ownership \(and not use the variable again\) or pay the cost of cloning. They add \`.clone\(\)\` to the call site, preserving the original for later use, understanding the trade-off of heap allocation versus architectural flexibility.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:42:18.820188+00:00— report_created — created