]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0368]: binary assignment operation `+=` cannot be applied to type `Foo` |
0731742a | 2 | --> $DIR/assignment-operator-unimplemented.rs:6:3 |
b7449926 | 3 | | |
532ac7d7 | 4 | LL | a += *b; |
b7449926 XL |
5 | | -^^^^^^ |
6 | | | | |
7 | | cannot use `+=` on type `Foo` | |
8 | | | |
c295e0f8 XL |
9 | note: an implementation of `AddAssign<_>` might be missing for `Foo` |
10 | --> $DIR/assignment-operator-unimplemented.rs:1:1 | |
11 | | | |
12 | LL | struct Foo; | |
13 | | ^^^^^^^^^^^ must implement `AddAssign<_>` | |
14 | note: the following trait must be implemented | |
15 | --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | |
16 | | | |
17 | LL | / pub trait AddAssign<Rhs = Self> { | |
18 | LL | | /// Performs the `+=` operation. | |
19 | LL | | /// | |
20 | LL | | /// # Example | |
21 | ... | | |
22 | LL | | fn add_assign(&mut self, rhs: Rhs); | |
23 | LL | | } | |
24 | | |_^ | |
b7449926 XL |
25 | |
26 | error: aborting due to previous error | |
27 | ||
28 | For more information about this error, try `rustc --explain E0368`. |