Closed
Description
This seems distinct from #10326.
Given
trait A<T> {
fn a(&self) -> &T;
}
struct B {}
impl<'a, T> A<B> for T {} // <-- not all trait items implemented, missing: `a` in implementation
, applying the "implement the missing item: …" helper leads to the following code (after formatting):
trait A<T> {
fn a(&self) -> &T;
}
struct B {}
impl<'a, T> A<B> for T {
fn a(&self) -> &T { // <-- method `a` has an incompatible type for trait\nexpected fn pointer `fn(&T) -> &B`\n found fn pointer `fn(&T) -> &T`
todo!()
}
}
This should instead be
trait A<T> {
fn a(&self) -> &T;
}
struct B {}
impl<'a, T> A<B> for T {
fn a(&self) -> &B { // <-- Ok
todo!()
}
}
as with the "Implement missing members" helper.
Metadata
Metadata
Assignees
Labels
No labels