lint: default methods must be called on Self to unconditionally recur.
This catches the case when a trait defines a default method that calls itself, but on a type that isn't necessarily `Self`, e.g. there's no reason that `T = Self` in the following, so the call isn't necessarily recursive (`T` may override the call). trait Bar { fn method<T: Bar>(&self, x: &T) { x.method(x) } } Fixes #26333.
Showing
想要评论请 注册 或 登录