]>
Commit | Line | Data |
---|---|---|
74b04a01 XL |
1 | $ cargo run |
2 | Compiling chapter10 v0.1.0 (file:///projects/chapter10) | |
6a06907d | 3 | error[E0369]: binary operation `>` cannot be applied to type `T` |
74b04a01 XL |
4 | --> src/main.rs:5:17 |
5 | | | |
6 | 5 | if item > largest { | |
6a06907d | 7 | | ---- ^ ------- T |
74b04a01 | 8 | | | |
6a06907d | 9 | | T |
74b04a01 | 10 | | |
fc512014 XL |
11 | help: consider restricting type parameter `T` |
12 | | | |
6a06907d | 13 | 1 | fn largest<T: std::cmp::PartialOrd>(list: &[T]) -> T { |
fc512014 | 14 | | ^^^^^^^^^^^^^^^^^^^^^^ |
74b04a01 XL |
15 | |
16 | error: aborting due to previous error | |
17 | ||
18 | For more information about this error, try `rustc --explain E0369`. | |
fc512014 | 19 | error: could not compile `chapter10` |
74b04a01 XL |
20 | |
21 | To learn more, run the command again with --verbose. |