🦀 Rust errors

Rust compiler errors (E0382, E0502, E0308…) — ownership, borrowing, lifetimes and types — explained simply.

CodeErrorWhat it means
E0308 Rust: error[E0308]: mismatched types — expected `X`, found `Y` A value’s type doesn’t match what the context expects — common with &str vs String, Option/Result vs plain va…
E0382 Rust: error[E0382]: borrow of moved value: `x` A value was moved (ownership transferred) and then used again.
E0502 Rust: error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable You tried to mutate a value while an immutable reference to it is still in use.