1 This error indicates that a binary assignment operator like `+=` or `^=` was
2 applied to a type that doesn't support it. For example:
5 let mut x = 12f32; // error: binary operation `<<` cannot be applied to
11 To fix this error, please check that this type implements this binary
15 let mut x = 12u32; // the `u32` type does implement the `ShlAssign` trait
20 It is also possible to overload most operators for your own type by
21 implementing the `[OP]Assign` traits from `std::ops`.
23 Another problem you might be facing is this: suppose you've overloaded the `+`
24 operator for some type `Foo` by implementing the `std::ops::Add` trait for
25 `Foo`, but you find that using `+=` does not work, as in this example:
35 fn add(self, rhs: Foo) -> Foo {
41 let mut x: Foo = Foo(5);
42 x += Foo(7); // error, `+= cannot be applied to the type `Foo`
46 This is because `AddAssign` is not automatically implemented, so you need to
47 manually implement it for your type.