Closed
Description
If I understand correctly, type parameter defaults have no effect in the block impl<T = default> Foo<T> { }
.
Just like in PR #30724, this should have a warning and then an error.
Example (playground)
use std::marker::PhantomData;
struct Foo<T> {
x: PhantomData<T>,
}
impl<T = i32> Foo<T> {
pub fn new() -> Self {
Foo { x: PhantomData }
}
}
fn main() {
let x = Foo::new(); // error: unable to infer enough type information about `_`
}