E4011#
Type parameters are not allowed on default implementation for traits.
Erroneous Example#
pub(open) trait Stringer {
stringify(Self) -> String
}
impl[T] Stringer with stringify(_self) { "hey" }
The example above uses a type parameter T
on the default implementation
of the Stringer
trait, which is not allowed.
Suggestion#
Remove the type parameter from the default implementation:
pub(open) trait Stringer {
stringify(Self) -> String
}
impl Stringer with stringify(_self) { "hey" }