Closed
Description
I could have sworn I read a similar issue a couple of days/weeks ago but I could not find it back. #37138 seems related too.
Shoudn't this code compile? playground
struct A;
trait Foo<T> {}
impl Foo<i32> for A {}
fn f<T>(_: T) where A: Foo<T> {
g(3i32);
// Works:
// g::<i32>(3);
}
fn g<T>(_: T) where A: Foo<T> {}
fn main() {
f(3);
}
error[E0308]: mismatched types
--> src/main.rs:6:7
|
6 | g(3i32);
| ^^^^ expected type parameter, found i32
|
= note: expected type `T`
found type `i32`
error: aborting due to previous error