summaryrefslogtreecommitdiffstats
path: root/src/doc/book/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt
blob: 1a705ed570327c84b4e0535a58dacb95adb8eae5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ cargo run
   Compiling chapter10 v0.1.0 (file:///projects/chapter10)
error[E0369]: binary operation `>` cannot be applied to type `&T`
 --> src/main.rs:5:17
  |
5 |         if item > largest {
  |            ---- ^ ------- &T
  |            |
  |            &T
  |
help: consider restricting type parameter `T`
  |
1 | fn largest<T: std::cmp::PartialOrd>(list: &[T]) -> &T {
  |             ++++++++++++++++++++++

For more information about this error, try `rustc --explain E0369`.
error: could not compile `chapter10` due to previous error