Consider the following Rust code [playground]:
use std::collections::HashMap;
use std::hash::Hash;
trait Foo {
const FOO: i32;
}
impl
Can I avoid eager ambiguity resolution for trait implementations with generics?
No.
Is it possible to have [ambiguity resolution to be done at the call site, rather than at the definition site]?
No.
There's a (long-delayed) RFC for specialization that will allow overlapping trait implementations, but only when one of them is more specific than the others. I don't believe this is true for your case, so it would not help.
See also: