Fix FP in external macros for mut_mut lint

This commit is contained in:
ThibsG
2021-10-09 15:54:16 +02:00
parent 22144c02c2
commit 1e18b8a269
4 changed files with 30 additions and 9 deletions

View File

@@ -82,6 +82,10 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for MutVisitor<'a, 'tcx> {
}
fn visit_ty(&mut self, ty: &'tcx hir::Ty<'_>) {
if in_external_macro(self.cx.sess(), ty.span) {
return;
}
if let hir::TyKind::Rptr(
_,
hir::MutTy {