ignore mutable self reference parameters
This commit is contained in:
parent
e03f73e627
commit
bfe610cc8d
4 changed files with 9 additions and 11 deletions
|
|
@ -104,8 +104,12 @@ impl EarlyLintPass for NeedlessArbitrarySelfType {
|
|||
}
|
||||
},
|
||||
TyKind::Rptr(lifetime, mut_ty) => {
|
||||
if let TyKind::Path(None, path) = &mut_ty.ty.kind {
|
||||
check_param_inner(cx, path, p.span.to(p.ty.span), &Mode::Ref(*lifetime), mut_ty.mutbl)
|
||||
if_chain! {
|
||||
if let TyKind::Path(None, path) = &mut_ty.ty.kind;
|
||||
if let PatKind::Ident(BindingMode::ByValue(Mutability::Not), _, _) = p.pat.kind;
|
||||
then {
|
||||
check_param_inner(cx, path, p.span.to(p.ty.span), &Mode::Ref(*lifetime), mut_ty.mutbl)
|
||||
}
|
||||
}
|
||||
},
|
||||
_ => {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue