ref_option_ref do not lint when inner reference is mutable
As it makes the `Option` Non Copy
This commit is contained in:
parent
967f172e25
commit
615b7617ed
2 changed files with 7 additions and 1 deletions
|
|
@ -52,7 +52,8 @@ impl<'tcx> LateLintPass<'tcx> for RefOptionRef {
|
|||
GenericArg::Type(inner_ty) => Some(inner_ty),
|
||||
_ => None,
|
||||
});
|
||||
if let TyKind::Rptr(_, _) = inner_ty.kind;
|
||||
if let TyKind::Rptr(_, ref inner_mut_ty) = inner_ty.kind;
|
||||
if inner_mut_ty.mutbl == Mutability::Not;
|
||||
|
||||
then {
|
||||
span_lint_and_sugg(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue