introduce the Comparable trait for BTree operations by conradludgate · Pull Request #144506 · rust-lang/rust (original) (raw)

An idea also came up to also provide blanket implementations of these traits for tuples of types implementing Borrow so that (String, String) could be indexed by (&str, &str).

Doesn't seem to be possible. (K1, K2) might be (&str, &str) which implements Borrow<(&str, &str)> which causes a conflict for Equivalent<(&Q1, &Q2)>

Right, impl<T> Borrow<T> for T gets in the way.

It would probably make a good example though, e.g. some kind of struct Lookup(&str, &str) newtype.