Open
Description
The following passes typeck and ICEs in MIR building for test
with the message encountered ambiguity selecting <std::option::Option<T> as Overlap> during codegen
:
trait Local {}
trait Overlap { fn f(); }
impl<T> Overlap for Option<T> where Self: Clone, { fn f() {} }
impl<T> Overlap for Option<T> where Self: Local, { fn f() {} }
fn test<T>()
where
Option<T>: Clone + Local,
{
<Option<T> as Overlap>::f();
}
test
is not really callable as coherence disallows adding a impl Local for Option
, but we should still return an ambiguity in case of overlapping impl candidates.