Rust E0382: borrow/use of moved value

Ownership of a non-Copy value was moved into another binding or function call.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.0.0
Identifier: Rust E0382 Platform: Rust
Common Root Causes:
  • Ownership of a non-Copy value was moved into another binding or function call.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Borrow by reference (&val), restructure lifetime scope, or explicitly .clone() where appropriate.
Safe Diagnostic Command:
cargo check --message-format=short
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Ownership of a non-Copy value was moved into another binding or function call. Recommended diagnostic: `cargo check --message-format=short`. Remediation: Borrow by reference (&val), restructure lifetime scope, or explicitly .clone() where appropriate.

Worked Examples

  • Run `cargo check --message-format=short` to confirm root cause before applying the fix.

Limitations & Assumptions

  • Always test configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-rust-e0382-use-of-moved-value · Independently verified: 2026-11-25

Related Resources