mirror of https://github.com/rust-lang/rust
17 lines
664 B
Plaintext
17 lines
664 B
Plaintext
error: lifetime may not live long enough
|
|
--> $DIR/return-value-lifetime-error.rs:13:47
|
|
|
|
|
LL | let _ = counts.iter().max_by_key(|(_, v)| v);
|
|
| ------- ^ returning this value requires that `'1` must outlive `'2`
|
|
| | |
|
|
| | return type of closure is &'2 &i32
|
|
| has type `&'1 (&i32, &i32)`
|
|
|
|
|
help: dereference the return value
|
|
|
|
|
LL | let _ = counts.iter().max_by_key(|(_, v)| **v);
|
|
| ++
|
|
|
|
error: aborting due to 1 previous error
|
|
|