blob: 81af024b3fb94abf058e189857efbb90dcbe06aa [file] [log] [blame]
error[E0283]: type annotations needed
--> $DIR/sort_by_key.rs:3:40
|
LL | lst.sort_by_key(|&(v, _)| v.iter().sum());
| ----------- ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
| |
| type must be known at this point
|
= note: cannot satisfy `_: Ord`
note: required by a bound in `slice::<impl [T]>::sort_by_key`
--> $SRC_DIR/alloc/src/slice.rs:LL:COL
help: consider specifying the generic argument
|
LL | lst.sort_by_key(|&(v, _)| v.iter().sum::<S>());
| +++++
error: aborting due to previous error
For more information about this error, try `rustc --explain E0283`.