E0502E0502 — Cannot Borrow as Mutable Because Also Borrowed as Immutable
A value cannot be mutably borrowed while an immutable borrow is still active.
E0308The function returns a Result with the wrong Ok or Err type.
The return type is Result<T, E> but the returned value has a different T or E type. The ? operator may be converting between incompatible error types.
Ensure Ok and Err types match the function signature. Implement From<ErrorType> for your error type to enable ? operator conversion. Use .map_err() to convert error types. Use a crate like anyhow or thiserror for ergonomic error handling.
fn foo() -> Result<(), String> {
Ok(42) // expected ()
}E0502A value cannot be mutably borrowed while an immutable borrow is still active.
E0277A type that does not implement Send is used in a context that requires thread-safety.
E0308The expected type does not match the actual type provided.
E0369A binary operator is used with types that do not support it.
E0106A reference in a function signature or struct is missing a lifetime parameter.
E0425An identifier is used but not defined in the current scope.