17 lines
519 B
Markdown
17 lines
519 B
Markdown
# Problem
|
|
|
|
Why does the doc test for `sub` under `impl<T> Sub for Point2<T>` work, but my
|
|
attempt to implement `area` under `impl<T> Bounds2<T>` fails to compile with:
|
|
|
|
```
|
|
error[E0369]: binary operation `-` cannot be applied to type `Point2<T>`
|
|
--> src/lib.rs:87:28
|
|
|
|
|
87 | let d = self.p_max - self.p_min;
|
|
| ---------- ^ ---------- Point2<T>
|
|
| |
|
|
| Point2<T>
|
|
|
|
|
= note: an implementation of `std::ops::Sub` might be missing for `Point2<T>`
|
|
```
|