The closest I could come up with a header for this would be

```
fn sort_by_key<K, F>(&self, mut f: F)
where
F: for<'a> FnMut(&'a T) -> (K + 'a),
K: Ord,
```

or perhaps

```
fn sort_by_key<K<'_ = 'static>, F>(&self, mut f: F)
where
F: for<'a> FnMut(&'a T) -> K<'a>,
K<'_>: Ord,
```

Is there any way to represent the extraction function being allowed but not required to return a reference into the `T`

? If you were adding that function today, would you do it this way or bake the idea of returning a self-reference into the conversion function (`F: for<'a> FnMut(&'a T) -> &'a K`

) and tell computed comparisons to use `sort_by`

?