From 39c0f575f2b291d683639afe4b016394d5c242bd Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Fri, 11 May 2018 09:50:29 +0200 Subject: [PATCH] Reintroduce the lost (im)mutability checks --- clippy_lints/src/mut_mut.rs | 2 +- clippy_lints/src/mut_reference.rs | 2 +- clippy_lints/src/ptr.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/mut_mut.rs b/clippy_lints/src/mut_mut.rs index 129f022606ad..501959e0f623 100644 --- a/clippy_lints/src/mut_mut.rs +++ b/clippy_lints/src/mut_mut.rs @@ -73,7 +73,7 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for MutVisitor<'a, 'tcx> { } else if let ty::TyRef( _, _, - _, + hir::MutMutable, ) = self.cx.tables.expr_ty(e).sty { span_lint( diff --git a/clippy_lints/src/mut_reference.rs b/clippy_lints/src/mut_reference.rs index a59909c48c89..1184433c4dde 100644 --- a/clippy_lints/src/mut_reference.rs +++ b/clippy_lints/src/mut_reference.rs @@ -64,7 +64,7 @@ fn check_arguments<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, arguments: &[Expr], typ ty::TyRef( _, _, - _, + MutImmutable, ) | ty::TyRawPtr(ty::TypeAndMut { mutbl: MutImmutable, diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs index fb9369c78a02..240b93e57299 100644 --- a/clippy_lints/src/ptr.rs +++ b/clippy_lints/src/ptr.rs @@ -153,7 +153,7 @@ fn check_fn(cx: &LateContext, decl: &FnDecl, fn_id: NodeId, opt_body_id: Option< if let ty::TyRef( _, ty, - _ + MutImmutable ) = ty.sty { if match_type(cx, ty, &paths::VEC) {