Open
Description
struct Foo<T = u32, U = i32>(T, U);
impl<T, U> Foo<T, U> {
fn foo() -> Self {
loop {}
}
}
fn main() {
let a = Foo::<u32, i32>::foo();
let b = Foo::<u32>::foo(); // ok
let c = Foo::<>::foo(); // ambiguity error
let d = Foo::foo(); // ambiguity error
}
The same way Foo::<u32>
instantiates U
with i32
, so should Foo::<>
for T
and U
.
My expected behavior is that d
is ambiguous while c
compiles