new_ret_no_self fix false positive for impl trait return with associated type self
This commit is contained in:
parent
13ce96c4bf
commit
1c4fa419f3
3 changed files with 25 additions and 9 deletions
|
|
@ -934,7 +934,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
|||
if let hir::ImplItemKind::Method(ref sig, id) = implitem.node {
|
||||
let ret_ty = return_ty(cx, implitem.id);
|
||||
if name == "new" &&
|
||||
!ret_ty.walk().any(|t| same_tys(cx, t, ty)) {
|
||||
!same_tys(cx, ret_ty, ty) &&
|
||||
!ret_ty.is_impl_trait() {
|
||||
span_lint(cx,
|
||||
NEW_RET_NO_SELF,
|
||||
implitem.span,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue