E0502E0502 — Cannot Borrow as Mutable Because Also Borrowed as Immutable
A value cannot be mutably borrowed while an immutable borrow is still active.
E0277A type is used in a for loop or iterator context but does not implement Iterator.
The type does not implement the Iterator trait, so it cannot be used in a for loop or with iterator methods like .map(), .filter(). Custom types need to implement Iterator manually.
Implement the Iterator trait for your type. Use .iter(), .into_iter(), or .iter_mut() on collections. Call a method that returns an iterator from your type.
E0502A value cannot be mutably borrowed while an immutable borrow is still active.
E0373A closure captures a reference to a variable that may not live long enough.
E0107A generic type or function is used with the wrong number of type parameters.
E0015A non-const function is called in a constant expression context.
E0277A type does not implement a required trait.
E0614The dereference operator (*) is used on a type that does not implement Deref.