-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsP-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
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 `_`
}
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsP-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team