The reason the compiler doesn't like this is because there's no guarantee
Vec<T> won't implement
FromStr at some point in the future (you have no control over the standard library), and if that happened you wouldn't know which impl to use.
There's an unstable feature called specialization which tries to relax those rules when it is provable that one blanket implementation is strictly more specific than another, but that wouldn't work here because there's no "stricter than" relation ship between
T: FromStr and
Vec<T> where T: FromPairs.
Often you can work around these sorts of overlapping impl rules by introducing another level of indirection (i.e. an intermediate trait). Kinda like how we have the
FromIterator trait because a direct
impl<I, T> From<I> for Vec<T> where I: Iterator<T> would overlap with
To X-Y your question, does your code ever use the
FromPairs trait as part of a generic function or are they all concrete uses of the type implementing
FromPairs? If the latter, you could be running into the Concrete Abstraction code and would gain a lot of clarity by dropping the
FromPairs trait altogether and using normal functions/methods.