Rust Error Messages
Memory-safe systems language and its compiler, rustc.All Rust pages
- Rust error[E0106]: missing lifetime specifierrustc E0106: a returned reference or a struct field needs a named lifetime the compiler cannot infer. Add <'a>, or return an owned String. Real output.
- Rust error[E0308]: mismatched typesRust E0308 means a value's type differs from what the compiler expected: a &str for a u16, String vs &str, or a missing return. Read expected/found and fix.
- Rust error[E0382]: borrow of moved valuerustc reports E0382 when a variable is used after its value moved to another binding or function. Borrow it with &, clone it, or reorder the code. Real output.
- Rust error[E0502]: cannot borrow as mutable because it is also borrowed as immutablerustc E0502: a shared reference is still alive when code needs &mut, as with v.push while holding &v[0]. Copy the value or end the borrow first. Real output.