Open
Description
Given
trait A<T: ?Sized> {
fn a(&self) -> &T;
}
trait B {}
impl<'a, T: B> A<dyn 'a + B> for T {} // <-- not all trait items implemented, missing: `a` …
, using the "Implement missing members" command leads to the following code:
trait A<T: ?Sized> {
fn a(&self) -> &T;
}
trait B {}
impl<'a, T: B> A<dyn 'a + B> for T {
fn a(&self) -> &dyn 'a + B { // <-- Syntax Error: ambiguous `+` in a type
todo!()
}
}
This should be
trait A<T: ?Sized> {
fn a(&self) -> &T;
}
trait B {}
impl<'a, T: B> A<dyn 'a + B> for T {
fn a(&self) -> &(dyn 'a + B) { // <-- Ok
todo!()
}
}
instead, as after then applying the "use parentheses to disambiguate: …" helper.